This article outlines the steps required to modify the DNS server settings on a Linux cloud server. Local DNS servers in various countries can be found through search engine queries; please replace them accordingly in practical application. This guide is applicable to a variety of Linux operating systems, including CentOS, Fedora, Ubuntu, Debian, and others.
1.Remotely log into the system.
2.Edit the file containing the DNS server settings.
vi /etc/resolv.conf
Alternatively,
nano /etc/resolv.conf
3.Replace [ns1] and [ns2] with the new DNS server addresses, and save the file by entering :wq.
nameserver [ns1]
nameserver [ns2]
4.Use the ping command to test several common domain names. If IP addresses appear, it indicates that the DNS server is functioning correctly.
ping www.google.com
23-02-2024 02:02:07
22-02-2024 03:19:32
22-02-2024 03:16:03
22-02-2024 03:14:03
22-02-2024 03:11:58