Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS import: src/external/bsd/dhcpcd/dist

David Holland <> writes:
On Fri, Jul 19, 2013 at 07:15:52PM -0700, Erik Fair wrote:
 > > * dhcpcd will now assign a short hostname by default
 > >  To use a FQDN hostname, set this in dhcpcd.conf(5)
 > >  env hostname_fqdn=YES
 > This is the wrong default, too - hostname should always be FQDN.

This is far from universally agreed upon.

However, ISTM that if dhcpcd is going to set the hostname at all
(which is usually wrong) it should set the hostname the dhcp server
provides and not try to munge it.

Which hostname should dhcpcd set?

DHCPv4 has these options:

DHCPv6 has these options:

Hmmm, so DHCPv6 has a few missing.
So if DHCPv4 is configured to send these options

hostname: foo


Of course, all these options are optional. It's equally valid for the FQDN option to appear in DHCPv4 as a latter RFC added it. What's more interesting is that depending if DHCPv6 happens before DHCPv4 (which is likely as the DAD checking is a lot faster even if the DHCPv4 handshake happens first).

It's equally possible the DHCPv4 hostname could contain the domainname as well, but this configuration dependent.

So what should dhcpcd do when assigning a hostname from this information? To provide a consistent result, assuming we have all the data, we can either set a short name or a FQDN.

I elected to set a short name, because it's the one guaranteed constant.
Also some distros like Debian state the hostname *must* be the short name. I did extensive research and could find no documentation for other distros to state FQDN or short name should be used. Certainly NetBSDs own documentation doesn't state this.

On a multi-homed system, bge0 could be and bge1 could be foo.deadbeef,org so in this instance again the short name is the correct answer.

I of course am open to discussion on why you think FQDN or straight through is better but you'll have to provide compelling argumentation rather than an opinion piece.



Home | Main Index | Thread Index | Old Index