dhclient-script ignores "option host-name" from DHCP-server
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dhcp3 (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
Bug Description
Binary package hint: dhcp-client
I have a set of machines running Ubuntu 9.10. These computers should receive their hostnames via DHCP from a DHCP server. For each host, the "option host-name" is set on the DHCP server and the lease file in "/var/lib/dhcp3" shows me, that the hostname was received.
However, the host name won't be set, even if /etc/hostname is deleted. It works this way with Debian.
I've figured out, that it can't work, since in /sbin/dhclient-
set_hostname() {
local current_
if [ -z "$current_hostname" -o "$current_hostname" = "(none)" ]; then
hostname "$new_host_name"
fi
}
If I delete /etc/hostname or keep it empty, Ubuntu sets the hostname automatically to "localhost" - therefore the upper script will fail. It now works, after changing it to:
if [ -z "$current_hostname" -o "$current_hostname" = "localhost" ]; then
Probably the way, how Ubuntu deals with a missing /etc/hostname differs from the way how Debian does...
Related branches
Changed in dhcp3 (Ubuntu): | |
importance: | Undecided → Low |
status: | New → Confirmed |
We have set /etc/hostname explicitly to '(none)'. Naturally, this is an illegal hostname, but since we use dhcp for our hostnames, the hostname is changed once the network is up.