LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-19-2008, 03:48 PM   #1
purrcy
LQ Newbie
 
Registered: Aug 2008
Location: I live in Santa Paula, CA
Posts: 27

Rep: Reputation: 15
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.
 
Old 08-19-2008, 04:02 PM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
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.
 
Old 08-19-2008, 04:20 PM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
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.
 
Old 08-19-2008, 04:32 PM   #4
purrcy
LQ Newbie
 
Registered: Aug 2008
Location: I live in Santa Paula, CA
Posts: 27

Original Poster
Rep: Reputation: 15
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.
 
Old 08-19-2008, 04:36 PM   #5
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
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.

Last edited by Mr. C.; 08-19-2008 at 04:38 PM.
 
Old 08-20-2008, 05:51 AM   #6
uncle-c
Member
 
Registered: Oct 2006
Location: The Ether
Distribution: Fedora 14, Ubuntu , Slax 5.1.8, OpenSolaris, Centos 4.8
Posts: 296

Rep: Reputation: 30
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.
 
Old 08-20-2008, 06:46 AM   #7
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

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

Yves.
 
Old 08-20-2008, 12:42 PM   #8
purrcy
LQ Newbie
 
Registered: Aug 2008
Location: I live in Santa Paula, CA
Posts: 27

Original Poster
Rep: Reputation: 15
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?
 
Old 08-20-2008, 12:46 PM   #9
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally Posted by purrcy View Post
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.
 
Old 08-22-2008, 07:05 PM   #10
purrcy
LQ Newbie
 
Registered: Aug 2008
Location: I live in Santa Paula, CA
Posts: 27

Original Poster
Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
hostname localhost problem theNOC Linux - Networking 4 02-15-2008 08:12 AM
How to change hostname ? - changing localhost Rommeo Slackware 15 01-01-2008 01:47 AM
my hostname has been changed from my computer name to localhost johnsanty Linux - Networking 3 10-01-2006 10:21 AM
hostname resetting to localhost on unclean reboot brian_h1 Linux - Networking 0 05-11-2004 08:18 PM
change hostname from localhost in samba Sathington Linux - Newbie 4 04-07-2004 05:27 AM


All times are GMT -5. The time now is 11:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration