setting resolvable hostname on a Linux laptop
Posted on 2006-06-10
The problem is this: how to set host name for a laptop running Linux
(Fedora Core 4, although the question is more general) such that the
name can be resolved successfully in all circumstances. The assumption
is that the laptop acquires IP address using DHCP protocol.
By `all circumstances' I mean that the name should be resolved on any
network that the laptop is connected to, as well as when it is not
connected to any networks.
By `name being resolved successfully' I mean that a command such as
$ ping laptop
should succeed, where `laptop' is the machine's hostname.
Needless to say, setting the host name in /etc/hosts file doesn't
work, since the IP address changes.
Thanks for your help,