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

Ok, in ubuntu hardy, though I might need to do this in both intrepid and jaunty as well soon enough, so if the process is different, I'd love to know how to do it for each of those as well, how can you set a static IP for the installation process which will hopefully carry over into the installed system? It needs to get online to check ntp servers for the time and what not, so I'd just like to be able to set a static IP from the time of that connection. It doesn't appear to give such an option. I think there are many ways to do this, but I'd really like to find an easy, non-hackety, "Don't repeat yourself," canonical way to do it. Obviously I will still need a nameserver, so please include a way to both set your own nameserver as well as set it to still get a nameserver address from dhcp. Thanks.

share|improve this question
up vote 0 down vote accepted

I did it along time ago but as I remember every Ubuntu asks if I want to use DHCP to configure the host or want to give a static IP. Just like a Debian install.

If I turn out to be wrong - I am 99.99% sure I will not - then disconnect from the DHCP server - not form the network -, or deny the MAC in the DHCP, and wait till the DHCP fails. The installation system will fall back to asking a static IP.

To include a nameserver edit /etc/resolv.conf

should look like:

nameserver (newline) nameserver

If you want a static address and DNS from DHCP, then write a rule in the DHCP to give always the same IP address for your server's MAC address

share|improve this answer
How do you disconnect from the DHCP server and not from the network? – EternallyGreen Jul 1 '09 at 6:11
for instance you connect to a swicth where you are the only one. you need to be conected to some network in order to keep the NIC 'alive'. after you assigned the staic IP you can connect back to the real network – raerek Jul 1 '09 at 18:10

Are you using the server install? Or if this is a desktop system are you using the alternate install CD, the installer will give you the opportunity to specify a network configuration. The alternate install CD can be heavily customized by providing options at boot time, or by preseeding.

You seem to want to set a static address, but still get DNS information from DHCP? Why? It would help if you provided more context about why you would need to do this. It is likely you may be trying to do in a way that is less then ideal. It sounds like what you may need is just to simply setup a DHCP reservation for that system.

share|improve this answer
Yeah, but the router sucks and doesn't support it. – EternallyGreen Jul 1 '09 at 6:13

Your Answer


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