Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Should I edit resolv.conf in my machine, or leave it 192.168.1.x and change something in the router? If in the router, how?

share|improve this question
what router? its better on the router since it will assign those using dhcp. – Bruno Pereira Oct 15 '11 at 11:48
up vote 3 down vote accepted

If you need to modify the nameserver addresses (because, e.g., your router's nameserver is slow) you can set them in the NetworkManager's Connection Editor.

If you don't use NetworkManager then, in Ubuntu 11.10 or earlier, add a line to /etc/resolv.conf such as the following one.


The address is the IP address of a public DNS server provided by Google, but of course you can use any other good DNS server IP address.

In Ubuntu 12.04 or later you cannot edit /etc/resolv.conf directly because it is generated dynamically and any manual changes will be overwritten. (Actually /run/resolvconf/resolv.conf is overwritten and /etc/resolv.conf is a symbolic link to the latter.) Instead you include nameserver addresses along with other information about each network interface. Again, if you use NetworkManager to configure an interface (a "connection" in NM parlance) then enter nameserver addresses accessible over that interface into the Additional DNS servers field for that interface, using the Connection Editor. If you use the ifup program to configure an interface, add the addresses onto a dns-nameservers line in /etc/network/interfaces. And so on.

share|improve this answer
Note that this answer does not apply to Ubuntu 12.04 or later, where /etc/resolv.conf is generated and should not be edited by hand. – jdthood Feb 14 '13 at 18:50
@jdthood Thank you for your improvements! – Lekensteyn Feb 15 '13 at 9:11

Since router IS the device that is connected to internet, you should play with DNS in router's GUI. How to get into router's interface and where to edit DNS, depends on what router you're using but i'm sure googling something like

<Routers model> DNS

will help. And yes, since it's router, it doesn't matter what OS you're using.


share|improve this answer
"Since router IS the device that is connected to internet, you should play with DNS in router's GUI." that's not necessarily true. – Lekensteyn Oct 15 '11 at 12:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.