# ubuntu /etc/hosts problem



## Slipaway172 (Apr 9, 2005)

hello,

i logged into my ubuntu machine today and it promopted that the internet address for ubuntu couldnt be aquired. i said adding ubuntu to the /etc/hosts file may resolve the problem. i cannot run the package manager, but all internet applications work. how do i fix this. in my /etc/hosts file this is all that is found in it


# The following lines are desirable for IPv6 capable hosts


thankyou


----------



## Whiteskin (Nov 16, 2002)

No. What needs to happen is that you need an ip adress. Try dhclient.


----------



## codejockey (Feb 11, 2002)

Well, I'm confused ... but not to worry, it happens often! )) ...

When you say that all internet applications work, do you mean that you can (for example) open a browser and surf the internet? If so, that suggests that you have an IP address already. Adding a site to the hosts file is most useful when the site is not in DNS (for whatever reason) but has an IP address. I know nothing about ubuntu, but I suspect that if you could surf the internet, the problem is likely some temporary condition with ubuntu that prevents them from being resolved through DNS.

OTOH, if you can surf to some sites but not others (besides ubuntu), your ISP may be having problems with their DNS resolution. Either way, you won't be able to do much about it; you'll have to wait until either ubuntu or your ISP fixes things.

Hope this helps.


----------



## Slipaway172 (Apr 9, 2005)

well i cant open the root terminal , wont open, just click and nothing happens. and when i type su and the root password it will ALWAYS say incorrect. and when i run dhclient all i get is this.

Internet Systems Consortium DHCP Client V3.0.1
Copyright 2004 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP

sit0: unknown hardware address type 776
can't create /var/lib/dhcp3/dhclient.leases: Permission denied
SIOCSIFADDR: Permission denied
SIOCSIFFLAGS: Permission denied
SIOCSIFFLAGS: Permission denied
SIOCSIFADDR: Permission denied
SIOCSIFFLAGS: Permission denied
SIOCSIFFLAGS: Permission denied
SIOCSIFADDR: Permission denied
SIOCSIFFLAGS: Permission denied
SIOCSIFFLAGS: Permission denied
sit0: unknown hardware address type 776
Open a socket for LPF: Operation not permitted


----------



## Whiteskin (Nov 16, 2002)

Do so as root. However, if the internet is already working (you can browse), then you may want to check out the adresses in /etc/apt/sources.list, and ensure they are correct.


----------



## codejockey (Feb 11, 2002)

> well i cant open the root terminal , wont open, just click and nothing happens. and when i type su and the root password it will ALWAYS say incorrect.


Unfortunately, you won't be able to get much beyond your problem without root access. All of your "permission denied" messages suggest that you should have been running as root in order to complete the commands. You may be able to reset your root password by booting from your distribution CD. Alternatively, are you sure you set a root password? -- have you tried just hitting enter at the root password prompt?

Hope this helps -- more info appreciated.


----------



## Slipaway172 (Apr 9, 2005)

i know my root password, also when i run the application under the start menu called root terminal , it wont load. i still cant become root


----------



## Whiteskin (Nov 16, 2002)

boot single user (append single at your grub prompt), and then run chpass. Reboot, and try again


----------



## ubuntunewbie (Aug 22, 2007)

I'm having a similar issue. My PIII machine can be pinged up until the Ubuntu login screen shows up. Once I login, I get the Network icon saying that there is "no network connection". This is a new issue and only occurred once I upgraded to Feisty Fawn from the previous distro.

I tried running dhclient as suggested, and it worked -- I was able to obtain a network address from my router. The Network icon still says "no network connection", but I am now able to be pinged by another machine on the network and can surf the net and run other network apps.

Any ideas what caused this and how I can permanently get rid of this (without adding dhclient to my login scripts).

Thanks!


----------



## lotuseclat79 (Sep 12, 2003)

Hi ubuntunewbie,

Welcome to TSG!

Please do not hijack someone else's thread. If you have an issue, start a thread of your own.

Try reading the Fiesty Starter Guide here for information on how to configure network access.

-- Tom


----------



## tomdkat (May 6, 2006)

Slipaway172 said:


> well i cant open the root terminal , wont open, just click and nothing happens. and when i type su and the root password it will ALWAYS say incorrect.


Does sudo not work for you either? Do you get incorrect password messages when you enter a command like:

$ sudo ifconfig

Peace...


----------

