Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 11-13-2004, 06:47 PM   #1
LQ Newbie
Registered: Nov 2004
Location: Pensacola, FL
Distribution: Fedora Core 3
Posts: 2

Rep: Reputation: 0
Smile Assigning Host Name Ineffective and Causing Errors

I have just installed Fedora Core 3 and have been trying to assign the machine a name (hostname?) so I wouldn't have to rely on using it's internal IP for all of my network configurations. It also "seemed" to be creating a problem in Samba as the linux computer was always referenced (and possibly treated?) as localhost in all the other computers networks. I'm on a small network, the machines are inside a modem/firewall/router and a hub. The modem handles DHCP and of course the ISP handles DNS. When I tried to change the hostname (what I understand to be the linux ver. of machine name) I used the command hostname, altered /etc/hosts, and etc/sysconfig/network but I kept recieving errors.

The errors varied from "improper hostname", "unable to resolve hostname", to Samba breaking and the machines being unable to communicate. Could anyone tell me a SAFE, CERTAIN way to change my hostname to something aside from localhost? There is no reason that I cannot assign a host name without a domain is there? If I must have a domain to have a hostname can I create and use any name for the domain? Wouldn't the other computers trying to reference shares on a computer called localhost cause an error?

I apologize for my ignorance, but many of the tutorials or how to's that I've read skipped or left stuff out, or just assumed you knew something and my knowledge of Linux networking is very limited. Any help, enlightenment, or links to easily understandable tutorials are appreciated.
Old 11-13-2004, 07:49 PM   #2
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
The proper way to change the hostname on a redhat based system is to edit /etc/sysonfig/network and set the HOSTNAME variable to a Fully Qualified Domain Name (FQDN). i.e. hostname + domain name. If you do not have a registered domain name, then you could use your ISP's domain name or even make up one (transposed.home) since you are behind a firewall. Just make sure your other computers are set to use the same domain name.

A good test to see if your hostname is correct....
[root@voyager fc3]# hostname --fqdn
[root@voyager fc3]# hostname --domain
[root@voyager fc3]# hostname --short 

[root@voyager fc3]# cat /etc/hosts       localhost.localdomain   localhost     voyager.transposed.home  voyager
...and a "net view" from my XP system to my FC box:
E:\scowles>net view \\voyager
Shared resources at \\voyager

Voyager - Fedora Server

Share name  Type  Used as  Comment

scowles     Disk           Home Directories
The command completed successfully.
Old 11-13-2004, 08:27 PM   #3
LQ Newbie
Registered: Nov 2004
Location: Pensacola, FL
Distribution: Fedora Core 3
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for the reply! I'm starting to resolve the problem, but I'm probably only half-way there. When I assigned the hostname previously, I assigned it through the terminal, network adapters, /etc/host, and /etc/sysconfig/network as many of the howto's I read sounded like they were inferring to change it through all of them. Perhaps somehow it created an error.

This time I simply changed the hostname AND the domainname through the terminal and nothing else and it worked. It stated that hostname was transposed and domain was ghost. However, upon rebooting it seems to have changed. When I ran the same commands as you I get these results:

[root@transposed ~]# hostname --fqdn
[root@transposed ~]# hostname --domain
[root@transposed ~]# hostname --short
[root@transposed ~]# hostname
[root@transposed ~]# domainname
[root@transposed ~]# hostname transposed
[root@transposed ~]# domainname ghost
[root@transposed ~]# domainname
[root@transposed ~]# hostname
[root@transposed ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.       localhost.localdomain   transposed.ghost        localhost      transposed
Should I assign the hostname and domainname to the internal ip on a second line like you did? Most everything I had read stated to put them in the first one along with localhost and localhost.localdomain so I'm a bit confused. Finally, your hostname has three sections, what is the third one? Thanks for your help!


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
upgraded to etch, xorg causing errors, HELP!!! microsoft/linux Debian 10 09-27-2005 07:02 PM
Fat32 Harddrive errors, causing system instability redness Linux - Hardware 2 02-01-2005 04:49 AM
ntp service causing huge time errors zoubidoo Linux - General 2 11-23-2004 11:29 AM
Slow Ram causing I/O errors? Boss Hoss Linux - Hardware 0 07-10-2004 10:10 AM
Sendmail, dynamic ip causing errors - how to resend via ISP dARkHunTEr Linux - Software 2 05-07-2004 05:32 AM > Forums > Linux Forums > Linux - Networking

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

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