[systemd-devel] Networkd dhcp hostname override

Dan Williams dcbw at redhat.com
Thu Aug 14 15:03:42 PDT 2014


On Thu, 2014-08-14 at 14:29 -0700, Thomas Suckow wrote:
> >> Typically the send-hostname thing is actually used for DNS updates,
> >> where you send the hostname to the DHCP server, which then gives you a
> >> lease and sends the hostname + IP to the DNS server, so that your
> >> machine is accessible via DNS automatically.  I've never heard of it
> >> being used as a Client ID, and AFAIK the "send hostname" and client ID
> >> can both be used at the same time.
> Yes. In my network the "Host Name" dhcp option is used to configure dns. I am attempting to use a single machine to operate several instances of the same server. Therefore I need to bind each server to a unique IP. Currently I use macvlan and dhcpcd to have the dns entries created.
> 
> >
> > this means that allowing to provide a custom hostname that is not set via hostname or hostnamectl makes no sense at all.
> 
> I will agree that conventionally in the linux world the hostname is for the system itself and not per interface.
> I suppose it needs to be decided whether it is tolerable for this convention to be "bent" in networkd. Bridged virtual machines effectively do the same thing, but one could argue it isn't really the same machine.
> 
> > Since you want to send your actual hostname.
> 
> In this case I don't, I want to specify a custom host name for dhcp on a specific interface.
> 
> > So current boolean for SendHostname is the right way to do this. In addition someone might add a ClientId=foo option.
> 
> I am not very familiar with the Client ID. It appears to only be useful to change if you wanted multiple dhcp leases with the same hardware address, which I have avoided with macvlans.

It's used as a general identifier of the client in any situation, so
that the server can pass back specific options.  Yes, this can be done
by looking at the client MAC address, but that's not sufficient in the
following cases:

1) non-Ethernet hardware addresses
2) dual-stack clients using DHCPv4 and DHCPv6
3) you change the NIC and want the same options
4) the NIC doesn't have a permanent MAC address

The client ID (and on the DHCPv6 side, the DUID) is the
single-identifier solution that should really be used instead of the MAC
address.

Dan



More information about the systemd-devel mailing list