HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   Screwed up Hostname on Ubuntu 6.06 LTS (http://www.howtoforge.com/forums/showthread.php?t=8170)

FrozenPixel 14th November 2006 01:51

Screwed up Hostname on Ubuntu 6.06 LTS
 
Ok I not only edited the hostname in:

/etc/host

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

but also in

/etc/hostname

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

I went -
#server1
server1.example.com

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

Thanks

falko 14th November 2006 15:40

Please try the steps shown in chapter 5 on http://www.howtoforge.com/perfect_setup_ubuntu_6.10_p3

FrozenPixel 14th November 2006 23:03

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

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.

falko 15th November 2006 16:52

Quote:

Originally Posted by FrozenPixel
After editing the /etc/host file as instructed

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

FrozenPixel 15th November 2006 23:44

Quote:

Originally Posted by falko
It's /etc/hosts, not /etc/host.

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

falko 16th November 2006 16:16

Ok, what's in /etc/hosts and /etc/hostname, and what's the output of
Code:

hostname
and
Code:

hostname -f
?

FrozenPixel 17th November 2006 01:55

Ok prior to editing /etc/hosts

127.0.0.1 localhost
127.0.0.1 myserver1

After editing /etc/hosts

127.0.0.1 localhost.localdomain localhost
192.168.0.1 myserver1.example.com myserver1

Execute after rebooting:

hostname
myserver1

hostname -f
myserver1.example.com

Prior to editing /etc/hostname
myserver1

After editing:
myserver1.example.com

Now issuing both commands matches each result.
myserver1.example.com

falko 17th November 2006 15:43

Quote:

Originally Posted by FrozenPixel
Now issuing both commands matches each result.
myserver1.example.com

So the problem is solved?

FrozenPixel 18th November 2006 20:45

Quote:

Originally Posted by falko
So the problem is solved?


Yes it is thank you.


All times are GMT +2. The time now is 15:11.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.