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?
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?
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.