sudo nano /etc/network/interfaces
auto lo eth0 iface lo inet loopback iface eth0 inet static address 192.168.1.101 netmask 255.255.255.0 gateway 192.168.1.1
If you are using ubuntu 14.04, you may find you can not setting dns on your /etc/resolv.conf
This is because ubuntu using resolvconf to manage the dns setting, every times system boot, resolvconf will regenerate resolv.conf file.
But there always have way to do this.
sudo gedit /etc/resolvconf/resolv.conf.d/base put your nameserver list in
nameserver 22.214.171.124 nameserver 126.96.36.199
this command tell resolvconf to regenerate the resolve file