Hi I've been trying and trying to chang emy ubuntu servers IP to static so I can have people join my Minecraft server that I have set up, I've been working on it for 2 days straight with no luck, when I change my ip through sudo gedit /etc/network/interfaces I was told to change it to something similiar to this iface eth0 inet static address netmask gateway

but it doesnt work for me i have tried in gateway putting my routers Ip address which i found in the routers menu information that doesnt seem to work what does is when i have the ip as or something similiar thoe i still have problems can anyone help I relaly want to get this set up and learn how to do this properly?

2 Answers 2


You will need to set your DNS servers manually too. Example:

vi /etc/resolv.conf

Add the lines (based on opendns):


restart your networking:

service networking restart

Double check your IP, Netmask and gateway. They look ok on the surface but make sure nothing else on the network is using

The section in your interfaces file should look similar to:

iface eth0 inet static

More information here: Set a static IP on Ubuntu

Dont forget to restart your networking after every change!


Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo gedit /etc/network/interfaces


iface eth0 inet dhcp 


iface eth0 inet static 

And add the following:

  • address (Ubuntu Server IP address)
  • netmask
  • gateway
  • network
  • broadcast
  • dns-nameservers

You can also use Google’s Public DNS which is or for dns-nameservers.

Once done, restart networking

sudo /etc/init.d/networking restart

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .