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:

# prepend domain-name-servers

Uncomment it and configure Google DNS accordingly.

prepend domain-name-servers,;

Note there is a ; at the end of line.

Next, restart network manager.

$ sudo service network-manager restart

The Google DNS should now be used first.

DNS settings.