LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 04-17-2003, 04:46 AM   #1
KennyK
Member
 
Registered: Apr 2003
Location: California, USA
Distribution: Redhat 8.0, 9.0 Suse 9.0 Pro
Posts: 129

Rep: Reputation: 15
Angry localhost.localdomain


During the instalation of a system, I didn't set the the name of the machine. So it was set to the default of localhost.localdomain. So I did the command;

hostname fileserver.mydomain

However, I am not sure if that is all that I have to do. I pico into /etc/hosts and it still says localhost.localdomain localhost

Also, at the shell screen it still says kenny@localhost

When I run the command hostname to get the output it does say fileserver.mydomain

What is going on?
 
Old 04-17-2003, 04:55 AM   #2
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
What distro are you using?

cheers

Jamie...
 
Old 04-17-2003, 05:01 AM   #3
KennyK
Member
 
Registered: Apr 2003
Location: California, USA
Distribution: Redhat 8.0, 9.0 Suse 9.0 Pro
Posts: 129

Original Poster
Rep: Reputation: 15
Redhat 8.0
 
Old 04-17-2003, 06:20 AM   #4
KennyK
Member
 
Registered: Apr 2003
Location: California, USA
Distribution: Redhat 8.0, 9.0 Suse 9.0 Pro
Posts: 129

Original Poster
Rep: Reputation: 15
Ok. I tried something else now. I ran the command
#hostname fileserver

and

#domainname mydomain

Now my shell screen does say kenny@fileserver

However, when I pico into /etc/hosts it still has the following;

127.0.0.1 localhost.localdomain localhost
 
Old 04-17-2003, 06:24 AM   #5
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
127.0.0.1 should be listed as localhost as this is the loopback addresses used by lots of software. You might also want to add your server's name after 'localhost' if you don't have any other IP addresses (say associated with a network card etc).

At boot time your system must read the hostname from somewhere and set it. So you'll find that your sucessful canges to you hostname won't survive a reboot. Take a look at /etc/sysconfig/network

cheers

Jamie...
 
Old 04-17-2003, 06:30 AM   #6
KennyK
Member
 
Registered: Apr 2003
Location: California, USA
Distribution: Redhat 8.0, 9.0 Suse 9.0 Pro
Posts: 129

Original Poster
Rep: Reputation: 15
I was told that there are several different places that need to have the hostname and domainname changed in order for it to work. He told me that the command will take care of it. But I guess it isn't working. Because both /etc/host and /etc/sysconfig/network still say localhost.localdomain

So you are telling me that if I reboot that machine, it will go back to localhost.localdomain?

How do I fix this?

Thanks
 
Old 04-17-2003, 06:37 AM   #7
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
Neither hostname or domainname change either of the files you've mentioned. You need to change them yourself.

At boot time settings are read from the relevant files and programs like hostname are called to set them for the system. The hosts file (/etc/hosts) is only used to resolve hostnames to ip addresses, it doesn't actually effect what hostname is used by a system.

Try editing /etc/sysconfig/network then reboot and see what happens. If you don't edit the files yourself then yeah - the hostname will be reset to localhost.localdomain the next time you reboot.

cheers

Jamie...
 
Old 04-17-2003, 06:45 AM   #8
KennyK
Member
 
Registered: Apr 2003
Location: California, USA
Distribution: Redhat 8.0, 9.0 Suse 9.0 Pro
Posts: 129

Original Poster
Rep: Reputation: 15
That did it thanks for your help.

One more thing. My friend also told me the reason that I had to change the name using the command was because there might be other parts of the system that will not know the name had changed and that the dependenies would be broke. Is this true?

Regards
 
Old 04-17-2003, 06:51 AM   #9
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
Quote:
Originally posted by KennyK
That did it thanks for your help.
Good good...

Quote:
Originally posted by KennyK
One more thing. My friend also told me the reason that I had to change the name using the command was because there might be other parts of the system that will not know the name had changed and that the dependenies would be broke. Is this true?
You were right to use hostname and domainname to change your settings, but to make it persistant accross reboots you needed to edit the files that the system reads at boot time to decide what it should set your hostname/domain name to. I'm sure that there is some nice graphical tool that you would typically use in Redhat to set this, but I've got no idea what it is.

Glad its sorted

Jamie...
 
Old 04-17-2003, 06:56 AM   #10
KennyK
Member
 
Registered: Apr 2003
Location: California, USA
Distribution: Redhat 8.0, 9.0 Suse 9.0 Pro
Posts: 129

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by jharris
I'm sure that there is some nice graphical tool that you would typically use in Redhat to set this, but I've got no idea what it is.

That's ok. I would rather learn how to do everything from the command line anyway. So far everything I was doing was using SSH through the network.

Thanks again.
 
  


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
localhost.localdomain steve007 Linux - Newbie 3 07-27-2005 03:48 AM
localhost.localdomain RJEmery Linux - Newbie 21 05-30-2005 03:59 PM
localhost.localdomain cryzpene Linux - Software 1 06-05-2004 11:57 AM
localhost.localdomain d1ny3 Mandriva 2 04-17-2004 08:27 PM
localhost.localdomain??? neozero62 Linux - Newbie 2 10-31-2003 10:25 AM


All times are GMT -5. The time now is 08:17 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration