Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Computer's hostname
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
sidkdbl07
Apprentice
Apprentice


Joined: 25 May 2003
Posts: 184

PostPosted: Sat Jul 03, 2004 7:19 pm    Post subject: Computer's hostname Reply with quote

Here is my /etc/hosts
Code:
127.0.0.1       localhost               smurfette
192.168.1.101   www.mydomain.com        www

but when I type hostname -f, I get
Code:
localhost

Why doesn't www.mydomain.com show up?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Sat Jul 03, 2004 7:29 pm    Post subject: Reply with quote

sidkdbl07,

You are looking in the wrong file.

/etc/hosts is for resolving names to IP addresses
The hostname is stored in /etc/hostname
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
kiezpro
Tux's lil' helper
Tux's lil' helper


Joined: 13 May 2004
Posts: 126
Location: Yes

PostPosted: Sat Jul 03, 2004 7:34 pm    Post subject: Reply with quote

Do your /etc/hostname and /etc/dnsdomainname contain the right values? Also, I think that in /etc/hosts, it should say
Code:

127.0.0.1          localhost               smurfette
127.0.0.1          www.mydomain.com        www
192.168.1.101   www.mydomain.com        www

That should do it.
Back to top
View user's profile Send private message
sidkdbl07
Apprentice
Apprentice


Joined: 25 May 2003
Posts: 184

PostPosted: Sun Jul 04, 2004 5:15 pm    Post subject: Reply with quote

/etc/hosts
Code:
127.0.0.1       localhost               smurfette       
192.168.1.101   www.mydomain.com        www

/etc/hostname
Code:
smurfette

/etc/dnshostname
Code:
mydomain.com
Back to top
View user's profile Send private message
kiezpro
Tux's lil' helper
Tux's lil' helper


Joined: 13 May 2004
Posts: 126
Location: Yes

PostPosted: Sun Jul 04, 2004 6:37 pm    Post subject: Reply with quote

Your /etc/hosts is lacking the second entry for 127.0.0.1 that should point to www. yourdomain.com (like in my example above) - that should be it.
Back to top
View user's profile Send private message
sidkdbl07
Apprentice
Apprentice


Joined: 25 May 2003
Posts: 184

PostPosted: Mon Jul 05, 2004 3:19 pm    Post subject: Reply with quote

My /etc/hosts
Code:
127.0.0.1       localhost               smurfette
127.0.0.1       www.mydomain.com        www
192.168.1.101   www.mydomain.com        www

... and when I type hostname -f is still outputs localhost

Any ideas?
Back to top
View user's profile Send private message
mike4148
l33t
l33t


Joined: 09 Sep 2003
Posts: 641

PostPosted: Mon Jul 05, 2004 3:29 pm    Post subject: Reply with quote

Either run
Code:
hostname smurfette

or
Code:
/etc/init.d/hostname restart

(note: if hostname is in the boot runlevel, that will restart a lot of stuff)
or reboot your computer (don't do that, please :)). The hostname isn't dynamically read from /etc/hostname; it's set by hostname, in Gentoo via the hostname init script.
Back to top
View user's profile Send private message
sidkdbl07
Apprentice
Apprentice


Joined: 25 May 2003
Posts: 184

PostPosted: Tue Jul 06, 2004 6:18 pm    Post subject: Computer's hostname [SOLVED] Reply with quote

My /etc/hosts

Code:
127.0.0.1       localhost
192.168.1.101   smurfette.wickedev.com smurfette


Restarted hostname and all is peachy. Thanks for the help.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum