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
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.
In this way, we can see that DNS will not disappear because the server is restarted.