pls refer:
http://www.linuxdiyf.com/viewarticle.php?id=87424
Step I): change the network config file.
1)run command :$ sudo vi /etc/network/interfaces
2)Find and remove dhcp entry:
iface eth0 inet dhcp
3)Append new network settings:
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254
Step II):Define new DNS servers
Open /etc/resolv.conf file
$ sudo vi /etc/resolv.conf
search myisp.com
nameserver 192.168.1.254
nameserver 202.54.1.20
nameserver 202.54.1.30
Step III) Restart the network
$ sudo /etc/init.d/networking restart
Step IV): check the network:
1)ping the gateway : ping 192.168.1.254
2)check dns server: host
www.XXX.com
3)ping the remote machine: ping host www.XXX.com
Reference: