Ubuntu: Correct way to set DNS


I have a DNS server running on my computer, and I want Ubuntu to use it to resolve addresses. I've setup mydomain.com as a custom domain

I went into Network settings, switched to manual in 'Wired', entered my IP, Gateway, Mask. And then I entered my IP in the DNS field.

How do I cause this to take effect? dig @myiphere mydomain.com works, but dig mydomain.com doesn't return any address.

If I edit /etc/resolv.conf by hand and change the first line from to myiphere, then everything starts to work.

But this doesn't seem to be the right way to do things as resolv.conf warns against manual changes by hand.

So how do I PROPERLY and reliably change DNS?


I would expect your network manager settings to apply and take care of resolv.conf.

You can alternatively manage this interface from /etc/network/interfaces, with a configuration similar to this one (example taken from "man resolvconf"):

iface eth0 inet static                 address                 netmask                 gateway                 dns-nameservers                 dns-search foo.org bar.com  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »