View previous topic :: View next topic |
Author |
Message |
Tsynique n00b
Joined: 17 Aug 2011 Posts: 7
|
Posted: Thu Aug 18, 2011 2:32 pm Post subject: [SOLVED] Periodically changing hostname |
|
|
Hello,
I'm dealing with this problem for a few days now. When Gentoo boots up, the hostname is set to 'localhost'. When wicd finishes connecting to a network (wired or wireless), the hostname changes to 'new-host'. This I managed to fix by adding a script Code: | hostname `cat /etc/hostname` | to all wicd script directories. However, after using the system for some time, the hostname changes on it's own again. First to 'new-host' then 'new-host-2', 'new-host-3', etc. I don't like this and really want to fix it but after googling and trying a number of solutions, nothing worked. Please help.
Here is my /etc/hostname and /etc/dnsdomainname:
/etc/hosts Code: | 127.0.0.1 localhost
::1 localhost |
Also the hostname daemon is added to rc: Code: | # rc-update show
bootmisc | boot
dbus | default
devfs | sysinit
dmesg | sysinit
fsck | boot
hostname | boot default
hwclock | boot
keymaps | boot
killprocs | shutdown
local | default
localmount | boot
modules | boot
mount-ro | shutdown
mtab | boot
net.lo | boot
netmount | default
procfs | boot
root | boot
savecache | shutdown
swap | boot
sysctl | boot
syslog-ng | default
termencoding | boot
udev | sysinit
udev-postmount | default
urandom | boot
wicd | boot
xdm | default |
BTW, when upgrading to kernel 3.0.3 I changed the default hostname to 'localhost' in menuconfig.
Last edited by Tsynique on Fri Sep 23, 2011 11:24 am; edited 1 time in total |
|
Back to top |
|
|
DaggyStyle Watchman
Joined: 22 Mar 2006 Posts: 5910
|
Posted: Thu Aug 18, 2011 2:58 pm Post subject: |
|
|
why wicd is placed in boot? afaik, all network related should be in default.
also, why hostname is in both boot and default?
leave it on boot only. _________________ Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein |
|
Back to top |
|
|
dwbowyer Apprentice
Joined: 18 Apr 2008 Posts: 155
|
Posted: Thu Aug 18, 2011 10:32 pm Post subject: Re: Periodically changing hostname |
|
|
I don't use wicd, so I can't answer anything directly about that. But:
Tsynique wrote: |
/etc/hosts Code: | 127.0.0.1 localhost
::1 localhost |
|
Why not change that to:
/etc/hosts Code: | 127.0.0.1 <long.host.name> <shortname> localhost
::1 localhost |
EDIT:
hostname --help wrote: |
This command can read or set the hostname or the NIS domainname. You can
also read the DNS domain or the FQDN (fully qualified domain name).
Unless you are using bind or NIS for host lookups you can change the
FQDN (Fully Qualified Domain Name) and the DNS domain name (which is
part of the FQDN) in the /etc/hosts file.
|
|
|
Back to top |
|
|
Tsynique n00b
Joined: 17 Aug 2011 Posts: 7
|
Posted: Fri Sep 23, 2011 11:24 am Post subject: |
|
|
Solved by changing hostname to "myhost". Helpful command to so: Code: | find /etc -type f | xargs grep "localhost" |
|
|
Back to top |
|
|
|