Focus on cloud service provider activities
Notes on website operation and maintenance

Linux View DNS Server Method and Change DNS

Have we found that the network and bandwidth of a server are good, but the application speed is not fast, especially when we choose overseas service providers. This is mainly because of the DNS problem of the server. We need to check and modify the DNS.

First, Linux View DNS

Here, we can use the SSH tool to link the server, and then use the cat command or the less command to query the DNS server IP address.

 cat /etc/resolv.conf

perhaps

 less /etc/resolv.conf

Or use the grep command.

 grep "nameserver" /etc/resolv.conf

The output here is the DNS server IP address.

Second, replace DNS in Linux

1. Add Profile

/etc/network/interfaces

Add at the end of this file

dns-nameservers 8.8.8.8
dns-nameservers 8.8.4.4

 Linux How to View DNS Server and Replace DNS - Page 1

Save the replacement after adding.

2. Execution document takes effect

resolvconf -u

It takes effect after the file is executed. Of course, it is better to restart the server and check whether the resolv.conf file has two more lines.

 Linux How to View DNS Server and Replace DNS - Page 2

In this way, we can see that DNS will not disappear because the server is restarted.

Vote for you
Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » Linux View DNS Server Method and Change DNS