[systemd-devel] Networkd dhcp hostname override

Marcel Holtmann marcel at holtmann.org
Thu Aug 14 13:53:06 PDT 2014

Hi Dan,

>>>> Now that networkd can send the systems hostname to the dhcp server, I would find it useful to have an option to override the hostname that gets sent.
>>>> In my use case, I would like to setup a number of macvlans with different hostnames.
>>>> Something as simple as
>>>> [DHCP]
>>>> SendHostname=true
>>>> Hostname=foo
>>> Sounds useful, though this could just be a single option
>>> SendHostname=foobar or so. If not set it sends the system hostname,
>>> otherwise the specified hostname. Or something like that.
>> what would this be useful for? Either you send the hostname or you don't.
>> I think what you are looking for is an option to set the Client ID. And when that is set, then that is used. If it not set and SendHostname=true, the hostname is used as Client ID. If SendHostname=false and Client ID is not send, then none of them are send.
> 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.

this means that allowing to provide a custom hostname that is not set via hostname or hostnamectl makes no sense at all. Since you want to send your actual hostname. So current boolean for SendHostname is the right way to do this. In addition someone might add a ClientId=foo option.



More information about the systemd-devel mailing list