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?

  • 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

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
| improve this answer | |
  • thx, I am getting, postconf: fatal: open /etc/postfix/main.cf: 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
  • 1
    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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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