Ubuntu 14.04+: Changing to Static IP

Whenever you make an Ubuntu Server box, it’s standard to make it a static IP. There are many other pages out there that say different things on how to do this, but most of them miss the whole DNS part of it, or they have you go through extra steps that aren’t necessary anymore.

First, edit /etc/network/interfaces:

Then change:


Then, add the following lines:

Here is an example of a completed static entry:

Save and exit.Then run the following to disable DHCP client for next reboot:

Finally, restart the interface (or just reboot):

That’s it! You can test by pinging Google/Yahoo/etc. The command ifconfig will show you the current configuration of network interfaces.