Bug#239591: Hostname needed for DHCP
Thiemo Seufer wrote:
Nick Lewycky wrote:
My @Home in Canada does this too. There's no reason to expect that the
hostname sent out with the DHCP request is related to the hostname of
the machine. I would be very disappointed if my hostname were
"cr979086-a" because that's the string to send with the DHCP request.
Probably netcfg-dhcp should still ask for a hostname then, but with
the DHCP reply's one as default value.
That's right, assuming you get a DHCP reply at all. I'm talking about a
case where the remote DHCP server will up and ignore you unless you toss
in a magic string when sending the request.
So here are the facts about my local machine:
- local hostname is wagon.
- FQDN is CPE0080c82b6fe5-CM014250030215.cpe.net.cable.rogers.com.
- must send "cr979086-a" to the DHCP server to connect.
It matters whether netcfg-dhcp asks about the hostname before or after
the DHCP happens. On a network like mine, here's what could happen:
Before:
1. ask user for local hostname, defaulting to debian
2. load local hostname into /etc/dhclient.conf
3. send out DHCP request, receive no response
X. if we try DHCP before asking the user about their connection method,
then ask the user now.
4. ask for client ID, load it into /etc/dhclient.conf and try again
5. we're now on the network
After:
1. send out DHCP request, receive no response
X. if we try DHCP before asking the user about their connection method,
then ask the user now.
2. ask for client ID, load it into /etc/dhclient.conf and try again
3. we're now on the network, retrieve hostname through DNS
4. ask user for local hostname, defaulting to the value from DNS as
default (if the ISP has reverse DNS) or the client ID (if it doesn't).
Nick Lewycky
Reply to: