Purpose : configure your system to use your choice of DNS servers.
Why update DNS servers addresses?
- you wish to use your own private DNS server
- access your network devices by using a FQDN (fully qualified domain name) instead of an IP address
- your ISP’s DNS servers are slow, creating a sluggish browsing experience
There are many free/public DNS servers. Here is a small list:
- Freenom: 126.96.36.199, 188.8.131.52
- Google: 184.108.40.206, 220.127.116.11
- OpenDNS: 18.104.22.168, 22.214.171.124
- FreeDNS: 126.96.36.199, 188.8.131.52
- Level3: 184.108.40.206, 220.127.116.11
- Cloudflare: 18.104.22.168, 22.214.171.124
- Quad9: 126.96.36.199, 188.8.131.52
When updating your DNS servers, always check with the provider to make sure they do not log any private information (e.g. requested IP addresses, ISP, or your geographic location)
To update the DNS servers on Debian you need to:
- edit the /etc/dhcp/dhclient.conf file
- restart the networking service
Simply adding the DNS servers to the /etc/resolv.conf file is not going to make the changes permanent. They will only last until your restart your dhcp client or reboot your system. This method is useful if you need to temporarily use or test new DNS servers.
1. Edit the /etc/dhcp/dhclient.conf file
To add static DNS servers that are used in addition to the ones provided by DHCP, use prepend
prepend domain-name-servers aaa.aaa.aaa.aaa, bbb.bbb.bbb.bbb
To completely override the DNS servers provided by DHCP, and entirely force the system to use only the ones you provide, use supersede
supersede domain-name-servers aaa.aaa.aaa.aaa, bbb.bbb.bbb.bbb
2. Restart the networking service
sudo /etc/init.d/networking restart
3. Check the /etc/resolv.conf file to make sure the new DNS servers where added.