Ubuntu 14.04 no longer allows you to edit /etc/resolv.conf directly. Instead, you have to modify /etc/resolvconf/resolv.conf.d/head or tail. The way it works is /etc/resolv.conf is written from:
- any dns set on interfaces
So, you can edit /etc/resolvconf/resolv.conf.d/head or base or tail, but it will be easiest to set this along side your ethernet config, in my opinion.
To set a static IP edit /etc/network/interfaces and change the following:
auto eth0 iface eth0 inet dhcp
auto eth0 iface eth0 inet static address 192.168.0.150 netmask 255.255.255.0 gateway 192.168.0.1 network 192.168.0.0 broadcast 192.168.0.255 dns-nameservers 220.127.116.11 18.104.22.168
Obviously, you will want to change eth0 to whatever your network card is called (hint: ifconfig) and change your dns-nameservers to whatever you want them to be. Now, if you want your DNS to come from your ISP then don't set any and it will work fine.
Finally, restart your ethernet:
$ service networking restart $ ifdown eth1 $ ifup eth1
Now, I'm not 100% sure all three commands are needed. But, I know that the above ensured that /etc/resolv.conf was re-written and the IP was taken.