Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently setup a linux box running Ubuntu 8.04 (to match another server with 8.04). I need to insure that this box has a static IP address and I changed /etc/network/interfaces to set up the static IP address and when I run sudo /etc/init.d/networking restart it works fine for a while, but always reverts back to after being idle for a while.

I also tried stopping/removing the dhcp client, but that didn't help.

sudo /etc/init.d/dhcp stop
sudo apt-get remove dhcp3-client

Here is my /etc/init.d/networking:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static

Any thoughts?

share|improve this question

The GNOME NetworkManager is what I suspect. I've always had to reboot to stop NetworkManager reverting the interface, but I suspect it is caching the information somewhere. At least try stopping and starting NetManager service first (/etc/init.d/network-manager stop|start).

You may want to ifdown eth0 the interface before restarting network manager, but I'm not sure if that helps or hinders.

share|improve this answer

you need to edit /etc/hosts and make it look like this       localhost.localdomain   localhost     server1
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

More info for you on this page.

share|improve this answer
That only determines host name resolution, not what IP address he gets. – Peter Eisentraut Jan 22 '10 at 6:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.