Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Hosts file and networking

  1. #1
    Join Date
    Sep 2006
    Beans
    52

    Hosts file and networking

    Hi
    Have just upgraded to Hardy Heron and trying to compile something but am getting the following error:

    ping: unknown host geko80

    When I am on geko80! Have checked my host file of which I include a copy here
    127.0.0.1 localhost

    # The following lines are desirable for IPv6 capable hosts
    fe00::0 ip6-localnet ip6-localnet
    ff00::0 ip6-mcastprefix ip6-mcastprefix
    ff02::1 ip6-allnodes ip6-allnodes
    ff02::2 ip6-allrouters ip6-allrouters
    ff02::3 ip6-allhosts ip6-allhosts
    192.168.1.80 geko80

    localhost ip6-localhost ip6-loopback

    Does any one know what I have done wrong?
    Thank you
    Adrian

  2. #2
    Join Date
    Mar 2007
    Beans
    Hidden!
    Distro
    Xubuntu 9.10 Karmic Koala

    Re: Hosts file and networking

    Go to system-->administration-->network, and make sure your hostname is set in the 'general' tab.

    If that looks ok but isn't working for some reason, you can add your hostname manually. Just add this line:
    Code:
    127.0.1.1     gecko80
    Underneath the '127.0.0.1 localhost' line of your hosts file with a text editor.

    You may need to restart networking after doing this:
    Code:
    sudo /etc/init.d/networking restart
    Added: Just saw the '192.168.1.80 geko80' line. I'd take this out. It's better to use the 127.0.1.1 form above for what you're doing because it will never need to change and will work even if the network is down.

    Still, I think what you had should have resolved, so you may have a different problem. If the above changes don't work, check your /etc/nsswitch.conf file, and make sure that 'files' is first on the list after 'hosts:' on the 'hosts:' line.
    Last edited by jetsam; April 28th, 2008 at 12:49 AM.

  3. #3
    Join Date
    Sep 2006
    Beans
    52

    Re: Hosts file and networking

    Well have seen some further problems, the main thing is not being able to use sudo so can not switch to root!, Kind of stops you from doing anything! have checked the network setings pop up and the general tab is OK but don't know what further to do?

    Has anyone got any other ideas?

    Adrian

  4. #4
    Join Date
    Apr 2008
    Location
    Phoenix, AZ
    Beans
    1,393
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Hosts file and networking

    Quote Originally Posted by madsurfer View Post
    Well have seen some further problems, the main thing is not being able to use sudo so can not switch to root!, Kind of stops you from doing anything! have checked the network setings pop up and the general tab is OK but don't know what further to do?

    Has anyone got any other ideas?

    Adrian
    Use the recovery mode option in the boot menu to get to a root shell. Then modify /etc/hosts as suggested.

  5. #5
    Join Date
    Sep 2006
    Beans
    52

    Re: Hosts file and networking

    I can't login as root anymore, sudo gives a message

    sudo: unable to resolve host geko80



    This is the same error that I had before! has anyone got any ideas of how to move forward with out reinstalling!

    Adrian

  6. #6
    Join Date
    Oct 2007
    Beans
    17
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Hosts file and networking

    That error means that you aren't able to resolve gekco80, it doesn't mean that you can't do "sudo". If you were unable to do "sudo" you would get a different error saying that you don't have permissions or something like that.

    Have you tried just pinging as a regular user, not through "sudo"?

    Type "hostname" in a terminal and make sure that you are in fact gecko80. Also verify that you can ping 127.0.0.1 (no reason you shouldn't be able to).

  7. #7
    Join Date
    Mar 2007
    Beans
    Hidden!
    Distro
    Xubuntu 9.10 Karmic Koala

    Re: Hosts file and networking

    A few people seem to be having similar problems.

    Interesting, a user in this thread reports gksudo working fine:
    http://ubuntuforums.org/showthread.p...t=can%27t+sudo

    If that's true, it should work to open a terminal and try:
    Code:
    gksudo gedit /etc/hosts
    and then make the changes to your hosts file.

    There's a longer thread developing about this issue here:
    http://ubuntuforums.org/showthread.p...t=can%27t+sudo

  8. #8
    Join Date
    Apr 2008
    Location
    Phoenix, AZ
    Beans
    1,393
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Hosts file and networking

    Quote Originally Posted by madsurfer View Post
    I can't login as root anymore, sudo gives a message

    sudo: unable to resolve host geko80



    This is the same error that I had before! has anyone got any ideas of how to move forward with out reinstalling!

    Adrian
    Recovery mode from the console does not work for you? You can also try the gksu method. The former approach worked for me.

  9. #9
    Join Date
    Apr 2008
    Beans
    2

    Re: Hosts file and networking

    I had the same problem recently. I had to use ctrl+alt+F1 to go into TTY mode. Then login as root. Next use the killall command.
    $ killall gdm
    This stops Xserve
    Next use startx to start a root xwin instance
    Next edit your hosts file with gedit
    Fix what you need to in the hosts file
    Then restart

  10. #10
    Join Date
    Sep 2006
    Beans
    52

    Re: Hosts file and networking

    have still got a problem every time try to do this, gksudo gedit /etc/hosts. the cmd just sits there and does nothing!! adrianr@geko80:~$

    gksudo gedit /etc/hosts

    Adrian

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •