There has been a significant change since Ubuntu 12.04 on how to manage DNS resolving.
Any changes made manually to
/etc/resolv.conf will be overwritten later by a DNS manager deamon called
/etc/resolv.conf becomes a symlink right now:
lrwxrwxrwx 1 root root 29 Apr 23 21:59 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
By default, it looks like this:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 127.0.0.1
How to configure DNS configuration for static IP?
auto eth0 iface eth0 inet static address ... netmask ... gateway ... dns-nameservers 220.127.116.11 18.104.22.168
How to change/override default DNS configuration
Resolvconf deamon contain four files
tail to help you override/change the default configuration. And they are all in
- base: Used when no other data can be found
- head: Header of default
resolv.conf. The server inside will the first ones to check.
- original: Just a backup of your original resolv.conf at the time of resolvconf is installed.
- tail: entries appended at the end of
resolv.conf. In some cases, upgrading from a previous Ubuntu release, will make tail a symlink to original
Resolvconf not working
resolv.conf is not auto populated/changed/updated.
sudo apt-get install resolvconf
sudo dpkg-reconfigure resolvconf
Although this is not recommended, one cam disable resolvconf by makeing
/etc/resolv.conf a regular file instead of a symlink.