How to change Ubuntu Server from dynamic address (DHCP) to a static IP address?

You need to change addresses into following files:

  • /etc/network/interfaces
  • /etc/resolv.conf

The following article from prefers vi editor, but I use nano editor.
sudo nano /etc/network/interfaces

change to something like this
iface eth0 inet static

and DNS settings
sudo nano /etc/resolv.conf
and then restart
sudo /etc/init.d/networking restart

If you have DHCP client enabled, you must disable it. Consult the following article for more details:

Ubuntu DHCP to a Static IP Address

Leave a Reply

Your email address will not be published.