Screwed up Hostname on Ubuntu 6.06 LTS

Discussion in 'Server Operation' started by FrozenPixel, Nov 14, 2006.

  1. FrozenPixel

    FrozenPixel New Member

    Ok I not only edited the hostname in:


    where I added the IP address: X.X.X.X server1

    but also in


    and this is where I screwed up. Instead of just entering:

    I went -

    And now I can't get back in to correct the problem, I keep getting
    sudo: unable to lookup #server1

    Now what should I do, reinstall??

    Ubuntu Server 6.06 LTS with LAMP

  2. falko

    falko Super Moderator

  3. FrozenPixel

    FrozenPixel New Member

    Thank you Falko. I had tried that but to no avail, having the 2 lines hostname has stopped any type of repair. I even just booted into recovery mode to no avail. I am currently reinstalling the OS and will chalk this up to a learning experience for a beginner Linux user.

    I did however rename the hostname because the steps in both the 6.10 and 6.06 version on the HowTo's do not produce the results as stated by issuing the commands:


    hostname -f

    as per instructions.

    After editing the /etc/host file as instructed those commands did not give identical results so hence the reason I went into /etc/hostname file top begin with.

    I also did not use the sudo passwd root but rather just executed the sudo -s as one members comments had suggested.

    These HowTo's are the best.
    Last edited: Nov 14, 2006
  4. falko

    falko Super Moderator

    It's /etc/hosts, not /etc/host.
  5. FrozenPixel

    FrozenPixel New Member

    Yes you are correct that was just a posting error, not when I actually issued the command.
  6. falko

    falko Super Moderator

    Ok, what's in /etc/hosts and /etc/hostname, and what's the output of
    hostname -f
  7. FrozenPixel

    FrozenPixel New Member

    Ok prior to editing /etc/hosts localhost myserver1

    After editing /etc/hosts localhost.localdomain localhost myserver1

    Execute after rebooting:


    hostname -f

    Prior to editing /etc/hostname

    After editing:

    Now issuing both commands matches each result.
    Last edited: Nov 17, 2006
  8. falko

    falko Super Moderator

    So the problem is solved?
  9. FrozenPixel

    FrozenPixel New Member

    Yes it is thank you.

Share This Page