How to setup DNS servers in Ubuntu server?
From time to time I need to set the DNS resolvers on some servers, however when I’m on ubuntu I always forget how to do that, I’m not sure why, but if you like me forget this stuff… look no further! the answer is here!
$ sudo vim /etc/resolvconf/resolv.conf.d/base
Inside this file specify your DNS servers like this:
nameserver 8.8.8.8
nameserver 8.8.4.4
Finally, reload the resolv conf with this command:
$ sudo resolvconf -u
That’s it! Go ahead and test your setup with a simple ping command:
$ ping google.com
It should work without any issues.