Configure Static IP Address and Set DNS in Ubuntu 15.10 Desktop and Server

Before we start this tutorial, I would like to begin with explaining what is an IP address what it is used for. The IP address is a unique set of numbers, separated with dots with which your computer identifies in a network via Internet Protocol.

IP addresses can by set dynamically by the network or statically. The difference between those are the dynamic IP address might be changed when connecting to a network, while the static IP address remains the same after each connection to a network.

Set Static IP Address in Ubuntu 15.10

Dynamic IP addresses are often used by ISPs to provide connection to their clients. Static IP addresses are often used on servers, so that a given server can be accessed over that IP address or domain pointed to the same IP address.

In this tutorial, we are going to show you how to configure or set a static IP address for both Ubuntu 15.10 Desktop and Server edition.

IP Network Settings

IMPORTANT NOTE: For the purpose of this tutorial, I will be using the following settings:

Make sure to use your own settings depending on the network to which you are connected to.

Set Static IP Address on Ubuntu 15.10 Desktop

If you’re using Ubuntu 15.10 Desktop edition, its’ easy to setup a static IP address. To start setting up the static IP address for your Ubuntu Desktop, start the Unity Dash and look for “Network Connections”

Ubuntu Network Connections

Next select the active wired connection and click the “Edit” button:

Edit Network Connections

In the newly opened window, select “IPv4 Settings” tab. This is where you edit the settings for IP version 4. Then in the dropdown menu next to “Method” select “Manual“:

Configure Network Connection

Now click the “Add” button and enter your IP address settings:

Set Static IP Address

You can now hit the “Save” button to apply the changes. If your computer previously used dynamic IP address, you will now need to reconnect to your network so the static IP address can be set. This can be done by using the “connection” setting in the top right corner:

Network Connections Status

After that used the same menu to connect again. Once you are connected to your network, use the “Connection information” to review your current settings:

Network Connection Information

Your network settings are now configured.

Assigning a Static IP Address to Ubuntu 15.10 Server

When configuring the network settings on our Ubuntu server, we don’t have the fancy GUI to help us. You will need to get your hands dirty and use the command line.

For the purpose of this tutorial, I am using “vim editor” as my text editor. You can choose different one as long as you are comfortable using it.

So let’s start. The first thing we need to do is find our network adapter. This can be done with the following command:

$ ifconfig -a

Now in my case the network adapter is called “enp0s3“. Changes are that your network connection will be either “eth0” or “eth1“. If you are using wireless network it would most probably be “wlan0” or “wlan1”

When ready, press the “Esc” button and type “:wq” without the quotes followed by “Enter” to save the changes. To apply the new configuration, you will need to restart your Ubuntu 15.10 networking with:

Conclusion

Be very careful when editing the network settings of your machines. Keep in mind that if you set the wrong configuration the machine may become inaccessible over the network.

This is why it would be nice to ensure that if something goes wrong with your desktop/server network settings you have physical access to the machine you are configuring or there is someone else on the other end who will be able to assist you.

This is especially important when you are editing the settings on remote server that is located on thousands miles away from your location.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

I am a bachelor in computer science and a Linux Foundation Certified System Administrator. Currently working as a Senior Technical support in the hosting industry. In my free time I like testing new software and inline skating.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

That’s actually a very interesting question and I did not think about it before. I just configured a static IP on one of my Ubuntu boxes and used grep from /etc/ folder recursively to search for that IP. The IP address was written in:

/etc/NetworkManager/system-connections/Wired\ connection\ 1

So if you need to look where the desktop tool has written your settings, you can look at:

Great article just wondering about this part: “Remember to replace “enp0s3” with the name of your network adapter??? what do u mean by this? do you mean we should not change this name enp0s3 or changed with our network adapter?
Cheers

Sorry for my english, I would put a secondary IP in the same interface, like old versions (eth0 192.168.1.100… eth0:1 10.10.0.100) I know how to do it in the old versions, but in version 15.10, they have changed the commands. Can you help me?

Can you please expand on this?
IMPORTANT NOTE: For the purpose of this tutorial, I will be using the following settings:

IP Address: 192.168.0.100
Netmask: 255.255.255.0
Gateway: 192.168.0.1
Nameserver: 8.8.8.8
Nameserver: 8.8.4.4
Make sure to use your own settings depending on the network to which you are connected to.
Where do you obtain the Nameserver numbers?