How to set up DNS in Ubuntu
You can add hostname and IP addresses to the file /etc/hosts for static lookups.
You can add your DNS Server Ip address for name lookups to /etc/resolv.conf.
For example If you want to add the DNS server at IP address 188.8.131.52
sudo vi /etc/resolv.conf
If you have GUI use the following command
gksudo gedit /etc/resolv.conf
enter the following details