Discover the latest user guides and tutorials.
This article describes the steps on how to modify the DNS server on a Linux cloud server. Local DNS servers in various countries can be found through search engines; please replace them when actually operating. This article applies to various Linux operating systems such as CentOS, Fedora, Ubuntu, and Debian.
1. Remotely log in to the system.
2. Modify the file containing the DNS server.
vi /etc/resolv.conf
or
nano /etc/resolv.conf
3. Replace `[ns1]` and `[ns2]` with the new DNS servers, and enter `:wq` to save the file.
nameserver [ns1]
nameserver [ns2]
4. Use the ping command to test some common domains. If IP addresses appear, it indicates that the DNS server is working properly.
ping www.google.com