In most of the case, Internet Service Providers providing the DNS servers to the customer. User can change it, the reasons to switch to other DNS servers for performance, privacy and censorship. Most of the people using OpenDNS as the first alternative, But Now Google Public DNS is available and the performance is much better.
Now How to set up Google Public DNS in Ubuntu
Select System-->Preferences-->Network Connections
Select the type of connection you have. For this example, we will use ‘Wired’.
Under ‘Wired’, highlight ‘Auto etho’ and click on ‘Edit’.
Now, Inside 'Editing Auto etho' window, click on ‘IPv4 Settings’ tab. and select 'Automatic (DHCP) address only'
Put these nameserver addresses as your ‘DNS Servers’:188.8.131.52, 184.108.40.206
Click ‘OK’ and reboot your machine.
For avoiding your settings get revoked after reboots, you may need to make the following changes via the command line:
$ sudo cp /etc/resolv.conf /etc/resolv.conf.auto
$ gksudo gedit /etc/dhcp3/dhclient.conf
# append the following line to the document
prepend domain-name-servers 220.127.116.11, 18.104.22.168;
# save and exit
$ sudo ifdown eth0 && sudo ifup eth0