December 30, 2015

96 words 1 min read

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:


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

It should work without any issues.