Wednesday, November 13, 2013

Google Backup for ISP DNS Servers

I'm using a standard WIFI setup where the ISP also provides the DNS server. In ubuntu Network Manager, this can be seen under connection information where the address of the DNS server is listed as '192.168.1.1', i.e. the ISP-provided router.

Recently, there were some problems: I could connect to machines using their numeric address (e.g. 91.189.90.58) but not using their 'name' (e.g. 'www.ubuntu.com'). It followed that the ISP's DNS server was down. It came back up after a few hours, but I decided that I needed a backup DNS server.

Fortunately, Google provides free public DNS servers at addresses 8.8.8.8 and 8.8.4.4.

After a lot of searching, I finally found out that defining these extra backup DNS servers is not done via the network manager but via the configuration file for the DHCP client which lives in

/etc/dhcp/dhclient.conf
For my purpose, it was sufficient to add the following line to this file:
append domain-name-servers 8.8.8.8 and 8.8.4.4;
Et voilà: next time the ISP's DNS server packed up, the system seamlessly switched to Google's servers.

No comments:

Post a Comment