Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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've installed ubuntu server on my computer. I would like to connect to the internet to download more software. I've done:

ifconfig eth0 up

so when I print


I can see the eth0 listed, but it doesn't have IP address. I tried to dhclient but that doesn't print anything.

What do I have to do first?

share|improve this question
you have static ip or dynamic? – user61928 Oct 8 '12 at 12:42
Right now, I dont have any. But there is DHCP on the server, where I want to connect. – tsusanka Oct 8 '12 at 12:44
up vote 7 down vote accepted

edit the /etc/network/interfaces

sudo vi /etc/network/interfaces

Change the file to look like this

#The primary network interface -- use DHCP to find our address
auto eth0
iface eth0 inet dhcp

then try the following commands:

dhclient -r

/etc/init.d/networking restart
share|improve this answer
thx, I am getting, postconf: fatal: open /etc/postfix/ No such file or directory. Btw there is not some network manager that would care about that? – tsusanka Oct 8 '12 at 12:56
and its deprecated.. – tsusanka Oct 8 '12 at 12:56
try this sudo dpkg-reconfigure postfix It will fix it – user61928 Oct 8 '12 at 13:02
Now it says (before too, sorry) grep: /etc/resolv.conf: No such file or directory. And it just hangs. Looks like we did some mistakes during install, didn't we? – tsusanka Oct 8 '12 at 13:09
try sudo dpkg-reconfigure resolvconf – user61928 Oct 8 '12 at 13:18

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.