For most users the DNS servers provided by their ISP may suffice, but some user may need DNS that are faster, safer and with far fewer restrictions for online browsing.
To change the DNS servers in Ubuntu, you need to modify the file ‘dhclient.conf’.
Open the terminal and give the following command:
sudo nano /etc/dhcp/dhclient.conf
Then uncomment the line below and add the DNS you want:
prepend domain-name-servers 220.127.116.11, 18.104.22.168;
Save the file (CTRL+X) and reboot. Now you’re using the chosen DNS (Google DNS if you used the ones listed above).