I recently experienced unstable DNS on my Ubuntu laptop. Here is how to configure the DNS settings so it always use the Google DNS servers first.

The DNS settings was obtained as part of DHCP response. We need to configure the DHCP client on the laptop to prepend our custom DNS servers.

Edit /etc/dhcp/dhclient.conf and find this line:

1
# prepend domain-name-servers

Uncomment it and configure Google DNS accordingly.

1
prepend domain-name-servers 8.8.8.8, 8.8.4.4;

Note there is a ; at the end of line.

Next, restart network manager.

1
$ sudo service network-manager restart

The Google DNS should now be used first.

DNS settings.