hostname change
When I installed sarge last time, I managed to insert my FQDN in as
hostname:
# hostname teufel.hartford-hwp.com
and now regret it. I must change my domain name to "hartford-hwp.com"
and leave my host name (name of my machine) as "teufel," so that the
FQDN ends up being teufel.hartford-hwp.com.
If I run the command:
# hostname hartford-hwp.com
That seems to change it for the current boot, but it had disastrous
consequences, such as making it impossible to bring up a terminal to
change it back.
I understand that the value of hostname resides in many places, and by
changing it only in /etc/hostname, I put my system out of sync.
1. If I change the value of /etc/hostname and reboot,
will that new value migrate through the system so that everything
ends up in sync? For example, does xterm reinspect the value of
hostname during a reboot?
2. If I set the value of hostname to be my domain name
(hartford-hwp.com), how does the name of my machine/host
("teufel"), which everyone recommends that it have, get its name?
In /etc/hosts I have:
127.0.0.1 localhost localhost.localdoman teufel.hartford-hwp.com
192.168.1.1 teufel teufel.localdomain
3. I could reconfigure the system base (# /usr/sbin/base-config) and
when prompted for hostname, put in just my domainname
(hartford-hwp.com), and then reboot, which I assume will propagate
this value to all applications. But where then do I define my
machine's name ("teufel")? As it is now,
$ hostname
teufel.hartford-hwp.com
$ hostname -d
[nothing regurns for domainname]
$ hostname -a
localhost.localdoman teufel.hartford-hwp.com
4. If a reboot after a change in hostname will not take care of
everything automatically, then it appears I must edit a number of
files that use the hostname. I gather I shoiuld first identify them:
$ find / -exec grep -l teuful.hartford-hwp.com {} \; 2>>/dev/null
and then edit each of these files by hand, including /etc/hostname,
to replace teufel.hartford-hwp.com with hartford-hwp.com
Unfortunately, I don't understand the syntax here of the find
command, and in any case, when run, nothing happens; the command
just hangs (or do I have to wait a very long time?).
If I did manage to get it to work, and I did change hostname value
everywhere, would this leave my system in sync with the new hostname
without having to reboot it?
--
Haines Brown
KB1GRM
Reply to: