Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 had some trouble getting the static ip configuration right for Ubuntu 12.04 Server. Every time I would restart the server the nameserver settings in /etc/resolv.conf would get overwritten by dhcp client. Many tutorials suggest doing an apt-get remove for dhcp-client but this didn't work for me either.

I found this page that documents how to do this in 12.04.


You basically need to add your nameserver settings in the /etc/network/interfaces file like so:

iface eth0 inet static
        address xx.xx.xx.xx
        netmask xx.xx.xx.xx
        network xx.xx.xx.xx
        broadcast xx.xx.xx.xx
        gateway xx.xx.xx.xx
        dns-nameservers xx.xx.xx.xx xx.xx.xx.xx

Note that dns-nameservers is where you add your DNS nameservers (they didn't get creative with the name, heh!)

share|improve this question
And it's not documented in man interfaces or man resolv.conf. The only way I found out is the note they left in resolv.conf "DO NOT EDIT THIS FILE BY HAND" – charlesbridge Jun 8 '12 at 18:55
up vote 1 down vote accepted

Unless they changed a lot in the latest version of Ubuntu static IPs should work just fine with the dhcp-client. Also I'd leave it on the machine in case you have to get a new dynamic IP.

But to answer your question :

If you read the package description ( it says :

Packages providing dhcp-client

    RFC2131 compliant DHCP client with IPv4LL support
    BOOTP and DHCP client for automatic IP configuration 

Which means that dhcp-client is in fact one of those packages. Usually it is dhcpd5. So you only have to :

sudo apt-get remove dhcpcd5
share|improve this answer
Thanks for the help. Since that tutorial I was using was so old I scoured google for the proper way to set a static ip for Ubuntu 12.04. I'm going to edit my post to help others. – Jason Jun 8 '12 at 18:16
Glad to see you found your way round. You should accept an answer so that the topic is closed ! – cete3 Jun 9 '12 at 0:00

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.