When we deploy a server, we use the default DNS setup by the server provider. For example, in the case of VULTR, their DNS server might be something like 127.0.0.53.
However, you might want to use a different DNS resolver – either for privacy, speed, redundancy or because the default DNS server is having issues.
The data for the DNS resolver is in the /etc/resolv.conf file.
Open the file in the NANO editor:
sudo nano /etc/resolv.conf
Somewhere in that file you should see at least one line that starts with the term nameserver followed by an ip address:
Just before that line, add your own resolver. For example:
You can add as many resolvers as you like. They will be evaluated in the order listed. For example:
When you ready to save the file:
ctrl-o Enter
Exit:
ctrl-x
The settings take effect immediately and there should be no need to restart the server.