LinuxQuestions.org
Visit Jeremy's Blog.
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 06-18-2005, 12:28 PM   #1
DeltaXFX
Member
 
Registered: Feb 2004
Location: USA
Distribution: Arch
Posts: 30

Rep: Reputation: 15
Angry changing localhost.localdomain results in error


I am using FC3.
I have one computer running FC3 with static IP and I changed the host.domain to webserver.xcubed
its /etc/hosts file looks like:

127.0.0.1 localhost.localdomain localhost
192.168.1.11 webserver.xcubed webserver

that computer runs fine, it is a samba and webserver and i have no problems with it.

my second FC3 computer i tried setting to server.xcubed, but evertime i change the hostname, ive tried changing it through the GUI, through /etc/HOSTNAME (but i dont know if thats even used in FC3), and through /etc/sysconfig/network and everytime i change it i can no longer run anything, like the terminal wont start, cant get to any websites, i end up booting to RL3 and changing /etc/hosts back to
127.0.0.1 localhost.localdomain localhost

just to get the computer to work right again.
ive made the changes to look like:
127.0.0.1 localhost.localdomain localhost
192.168.1.10 server.xcubed server

which is just like the one on the first computer. except i have the problem with the computer not responding. im using static IP on this computer also. i want to use this computer as a SAMBA server, and i actually am able to, but when i view it from windows it is called localhost (which is why im trying to change that in the first place)
Ive read most of the threads that have anything to do with hostnames, and all ive gotten from them is how to change the hostname, which ive tried, but without success.

heres another bit of info that might help. if i have the terminal running when when i change the hostname.domainname i get an error when i try to do anything from the terminal, like open emacs. here is the error:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

emacs: Cannot connect to X server :0.0.
Check the DISPLAY environment variable or use `-d'.
Also use the `xhost' program to verify that it is set to permit
connections from your machine.


any help is much appreciated!
thanks

Last edited by DeltaXFX; 06-18-2005 at 07:17 PM.
 
Old 06-18-2005, 01:28 PM   #2
Pete M
Member
 
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 32
DeltaXFX

Quote:
just to get the computer to work right again.
ive made the changes to look like:
127.0.0.1 localhost.localdomain localhost
192.168.1.10 server.xcubed webserver
Is this a typo, should'nt it read

127.0.0.1 localhost.localdomain localhost
192.168.1.10 server.xcubed server

Where "xcubed" is your domain name and "server" is your machine name

Also you need to add "server" to /etc/sysconfig/network

HOSTNAME=server

This is from my Redhat 9 days so may be way off mark

Pete
 
Old 06-18-2005, 01:29 PM   #3
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
set your hostname (/etc/sysconfig/network):
$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=host.domain.com
GATEWAY=xx.xx.xx.xx

and set your /etc/hosts like this:
$ cat /etc/hosts
127.0.0.1 host.domain.com host localhost.localdomain localhost

and reboot.

i hope it will help.
good luck
 
Old 06-18-2005, 07:17 PM   #4
DeltaXFX
Member
 
Registered: Feb 2004
Location: USA
Distribution: Arch
Posts: 30

Original Poster
Rep: Reputation: 15
maxut-
that was it! thanks so much.
any idea though why it works ok on the first computer with /etc/hosts as:

127.0.0.1 localhost.localdomain localhost
192.168.1.11 webserver.xcubed webserver

and
$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=webserver.xcubed
(there is no gateway listed on mine)

but its working now so thats no big deal
 
Old 06-20-2005, 07:09 AM   #5
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
if u use X, your hostname must be resolved to an ip. and that ip must be assinged to your computer. so 127.0.0.1 is the best option, because loopback is always same. X and other some of network services connect to your computer solving the hostname. also make sure firewall rules don't block network traffic on loopback. it may cause like this troubles too.

as"Pete M" said, u must not do typo mistake

good luck.
 
  


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 error Roach Linux - Newbie 4 08-11-2004 12:40 AM
localhost.localdomain cryzpene Linux - Software 1 06-05-2004 11:57 AM
changing Localhost.localdomain Brother Michael Linux - Newbie 6 08-18-2003 09:01 PM
Changing localhost@localdomain??? TMMO Linux - Networking 2 08-10-2003 11:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

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
Open Source Consulting | Domain Registration