LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 11-13-2004, 05:47 PM   #1
transposed
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, 06:49 PM   #2
scowles
Member
 
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....
Code:
[root@voyager fc3]# hostname --fqdn
voyager.transposed.home
[root@voyager fc3]# hostname --domain
transposed.home
[root@voyager fc3]# hostname --short 
voyager

[root@voyager fc3]# cat /etc/hosts
127.0.0.1       localhost.localdomain   localhost
192.168.9.3     voyager.transposed.home  voyager
...and a "net view" from my XP system to my FC box:
Code:
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, 07:27 PM   #3
transposed
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:

Code:
[root@transposed ~]# hostname --fqdn
localhost.localdomain
[root@transposed ~]# hostname --domain
localdomain
[root@transposed ~]# hostname --short
localhost
[root@transposed ~]# hostname
transposed.ghost
[root@transposed ~]# domainname
(none)
[root@transposed ~]# hostname transposed
[root@transposed ~]# domainname ghost
[root@transposed ~]# domainname
ghost
[root@transposed ~]# hostname
transposed
[root@transposed ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       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!
 
  


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


All times are GMT -5. The time now is 05:37 PM.

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