How to edit network settings manually in Ubuntu Server 12.04 (Precise)
Changing network settings in new versions of Ubuntu (don’t know when exactly this new methodology started) like Ubuntu 12.04 Precise Server Edition, has a major difference from the old methodology.
The major change is that you no longer need to edit “/etc/resolv.conf”, and if you try to, your settings will be lost or overwritten once you reboot.
All what you need to change if you want to apply a static address (which is the case in almost all server installations) is the “/etc/network/interfaces” file.
iface eth0 inet static
dns-nameservers xx.xx.xx.xx xx.xx.xx.xx xx.xx.xx.xx
You will notice that everything is the same, except the last line which used to be added to the /etc/resolv.conf directly before. With this new methodology the “resolvconf” utility will automatically read the “dns-nameservers” one by one (separated by a space) and will append them to the “etc/resolv.conf” file.
After that to apply your changes, you can just do “sudo /etc/init.d/networking restart” or simply reboot your machine if you wish.