LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Hostname: Localhost (https://www.linuxquestions.org/questions/linux-newbie-8/hostname-localhost-663903/)

purrcy 08-19-2008 03:48 PM

Hostname: Localhost
 
I'm a newbee from XP. I got tired of reinstalling XP so many times that Microsoft doesn't want to hear from me anymore. I installed PCLOS recently and a message occured that said that my Hostname is Localhost. I don't know how that happened and I don't know how to change it in Linux. It would save me a lot of time if someone could just tell me how to do that. It would be a nice consideration too.

Mr. C. 08-19-2008 04:02 PM

localhost is the name given to the loopback interface; you can always use localhost to address the host itself from the host itself.

The hostname command will allow you to set/read your hostname. Distro's have many variants of how hostname is set, but ultimately, they all end up setting hostname the same way.

An entry for your hostname is also added to the /etc/hosts file so that the hostname resolves correctly.

I don't know PCLOS's method for setting hostname.

tredegar 08-19-2008 04:20 PM

Welcome to LQ!

Your PCs name is set in the file /etc/hostname

See man hostname and man hosts for more details.

Edit (as the root user) the file /etc/hostname and enter a new hostname there.

Then, reboot. There are not many times a linux system needs rebooting, but changing the hostname is one of them.

purrcy 08-19-2008 04:32 PM

Thx for the fast response, Mr. C. PCLOS, like XP, is based on GUI. That makes it nice for us XP converts. I haven't gotten into the command lines, yet. So you're talking over my head about the "localhost command" and where localhost is. I've been trying to figure out how PCLOS's GUI can solve this problem and I just haven't figured it out yet. It's been a long time since I've had any dealings with MSDOS (which, like me, has been around for a long time,) so if you could give me some more details on how to use the command line to solve this problem I would appreciate it.

Mr. C. 08-19-2008 04:36 PM

There will be some GUI control, probably in some Networking applet, that allows you to change your hostname.

Startup PCLOS' terminal or console program to enter command line commands. Sorry I can't be more specific, not knowing PCLOS.

uncle-c 08-20-2008 05:51 AM

When I tried to change the hostname on PCLOS the changes were not permanent. I asked on the IRC channel for PCLOS and was told that there was a bug and the method to use to make the change permanent was to use the GUI applet in the system / network settings. The same applied to DNS server changes.

uc.

theYinYeti 08-20-2008 06:46 AM

The simplest way is to edit the /etc/sysconfig/network file as root and change the value after
HOSTNAME=

Yves.

purrcy 08-20-2008 12:42 PM

Hostname: Localhost
 
OK. I've tried all of these solutions and when I call up the Control Center it still says that my Hostname is localhost. What's next?

trickykid 08-20-2008 12:46 PM

Quote:

Originally Posted by purrcy (Post 3253998)
OK. I've tried all of these solutions and when I call up the Control Center it still says that my Hostname is localhost. What's next?

Have you rebooted after making these changes? This control center probably reads upon the first launch of it and caches the hostname or doesn't reread til a reboot or the like.

purrcy 08-22-2008 07:05 PM

Hostname: Localhost
 
Thanks for all your help. I've gone on to Mandriva KDE. I'm sure I'll have some questions to post about this OS soon.


All times are GMT -5. The time now is 08:24 PM.