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?
2 Answers
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.
nameserver 8.8.8.8
The address 8.8.8.8
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.
-
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.– jdthoodFeb 14, 2013 at 18:50
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.
Cheers!
-
"Since router IS the device that is connected to internet, you should play with DNS in router's GUI." that's not necessarily true. Oct 15, 2011 at 12:04