How To Set Static IP and DNS On Ubuntu Server 14.04 LTS

How To Set Static IP and DNS On Ubuntu Server 14.04 LTS

For setup a Static IP and DNS on Ubuntu edit file: “/etc/network/interfaces

sudo vi /etc/network/interfaces

Then make changes like:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4

 

After the changes you can run commands:

sudo ifdown eth0
sudo  ifup  eth0

or

# reboot

arstech