Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
hostname won;t change from localhost
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
LittleSpy
n00b
n00b


Joined: 02 Apr 2009
Posts: 10

PostPosted: Sun May 10, 2009 7:49 pm    Post subject: hostname won;t change from localhost Reply with quote

I can't seem to get my hostname to change from localhost. When I frist start my computer it says matt-laptop as it should. As soon as I log into gnome my hostname is changed to localhost. I have HOSTNAME="matt-laptop" set in /etc/conf.d/hostname and I don't even have localhost in /etc/hosts just 127.0.0.1 matt-laptop. Has anyone else had this problem or know of what might be happening? I guess it has to be some program that is starting when X/gnome starts.
Back to top
View user's profile Send private message
booleandomain
n00b
n00b


Joined: 02 May 2009
Posts: 62

PostPosted: Sun May 10, 2009 8:22 pm    Post subject: Reply with quote

is the hostname script in your boot runlevel? you can check with eselect rc list boot | grep hostname. also, what version of openrc do you have?
Back to top
View user's profile Send private message
tgR10
Apprentice
Apprentice


Joined: 23 Oct 2007
Posts: 262
Location: caly ten ambaras

PostPosted: Sun May 10, 2009 11:11 pm    Post subject: Reply with quote

what about those 2 commands
Code:
rc-update show |grep hostname
rc-status -a|grep hostname

imo rc-update > eselect in this case :P
_________________
"bo kto ma racje ? ten kto z bliska zobaczy"
"moge nie wiedziec,wchlaniam niewiedze z malych torebek"
http://i12.tinypic.com/4pow0mu.png
http://userbar.tgr.debil.eu/userbar.jpg
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Sun May 10, 2009 11:13 pm    Post subject: Reply with quote

possible dhcp is overwriting this?

be a strange change to make for dhcp, but well...possible
Back to top
View user's profile Send private message
wdsci
Tux's lil' helper
Tux's lil' helper


Joined: 02 Oct 2007
Posts: 149
Location: US

PostPosted: Wed Aug 26, 2009 6:32 pm    Post subject: Reply with quote

Just an update in case this is useful for anyone in the future: I was having the same problem. It turned out that NetworkManager was setting the hostname to "localhost" as indicated by these lines in the system log:
Code:
Aug 26 11:49:03 laptop07 NetworkManager: <info>  Retrieved the following IP4 configuration from the DHCP daemon:
Aug 26 11:49:03 laptop07 NetworkManager: <info>    address 192.168.4.107
Aug 26 11:49:03 laptop07 NetworkManager: <info>    netmask 255.255.255.0
Aug 26 11:49:03 laptop07 NetworkManager: <info>    broadcast 192.168.4.255
Aug 26 11:49:03 laptop07 NetworkManager: <info>    gateway 192.168.4.1
Aug 26 11:49:03 laptop07 NetworkManager: <info>    nameserver 127.0.0.1
Aug 26 11:49:03 laptop07 NetworkManager: <info>    nameserver 208.67.222.222
Aug 26 11:49:03 laptop07 NetworkManager: <info>    nameserver 208.67.220.220
Aug 26 11:49:03 laptop07 NetworkManager: <info>    hostname 'localhost'
Aug 26 11:49:03 laptop07 dhcdbd: message_handler: message handler not found under /com/redhat/dhcp/eth0 for sub-path eth0.dbus.get.interface_mtu
Aug 26 11:49:03 laptop07 NetworkManager: <info>  Activation (eth0) Stage 5 of 5 (IP Configure Commit) scheduled...
Aug 26 11:49:03 laptop07 NetworkManager: <info>  Activation (eth0) Stage 4 of 5 (IP Configure Get) complete.
Aug 26 11:49:03 laptop07 NetworkManager: <info>  Activation (eth0) Stage 5 of 5 (IP Configure Commit) started...
Aug 26 11:49:03 laptop07 NetworkManager: <info>  Old device 'eth0' activating, won't change.
Aug 26 11:49:04 laptop07 NetworkManager: <info>  Setting hostname to 'localhost'

After some trial and error, I found out that I could fix the problem by commenting out two lines in the file /etc/dhcp/dhclient.conf:
Code:
#send host-name "localhost";
#supersede host-name "localhost";

Now my hostname stays as what I set it to in /etc/conf.d/net.

I got a few error messages from BIND in the system log, like this
Code:
Aug 26 14:22:59 laptop07 named[5847]: network unreachable resolving 'c3.nstld.com/A/IN': 2001:503:ba3e::2:30#53

but they don't seem to indicate a problem with the networking.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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