Setting Static IP in Ubuntu
Set your IP address changes in
/etc/network/interfaces
. Example:auto eth0
iface eth0 inet static
address 192.168.1.128
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
Don't give your DNS configurations in
/etc/resolv.conf
because while we restart the server sometimes the configuration get erased.
So use
nano /etc/resolvconf/resolv.conf.d/base
(while updating configs in this it doesn't get removed)
example:
search (domain name)
nameserver 8.8.8.8
nameserver 8.8.4.4
Then restart networking
sudo service networking restart
Comments