How to modify the DNS server on a Linux cloud server. Local DNS servers in various countries can be queried through search engines. Please replace them during actual operation. This article is applicable to various Linux operating systems such as CentOS, Fedora, Ubuntu, and Debian.
1. Remotely log in to the system.
2. Modify the file where the DNS server is located.
vi /etc/resolv.conf or nano /etc/resolv.conf
3. Replace [ns1] and [ns2] with the new DNS server, and enter :wq to save the file.
nameserver [ns1]
nameserver [ns2]
4. Use the ping command to detect some common domain names. If the IP address appears, it means that the DNS server is running normally.
ping www.jtti.cc
5. Here are some commonly used DNS addresses
Telecom: preferred: 101.226.4.6
China Unicom: preferred: 123.125.81.6
China Mobile: preferred: 101.226.4.6
China Railway Communications: preferred: 101.226.4.6
114 DNS 114.114.114.114