We prefer Google Public DNS for Ubuntu Server.
Below are steps to get it/
/etc/resolv.conf file and paste following lines in it:
nameserver 188.8.131.52 nameserver 184.108.40.206
Remove/comment out any existing lines. That’s it. 🙂
ping any domain/hostname. If you get “Failed to resolve host:” error, then there is something wrong in network configuration (apart from DNS).
Note: You can always ping IP address even if your machine do not any have nameserver entries or nameservers are down.