mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
sd-dhcp-server: Add Hostname= option to static leases
This adds a new `Hostname=` option to the [DHCPServerStaticLease] section in .network files, allowing an administrator to assign a specific hostname to a client receiving a static lease. We automatically select the correct DHCP option to use based on the format of the provided string: - Single DNS labels are sent as Option 12. - Names with multiple DNS labels are sent as Option 81 in wire format. Fixes: #39634
This commit is contained in:
@@ -4227,6 +4227,25 @@ ServerAddress=192.168.0.1/24</programlisting>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v249"/></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>Hostname=</varname></term>
|
||||
|
||||
<listitem><para>The hostname to send to the client in DHCP replies. This can be either a simple
|
||||
hostname (e.g., <literal>mydevice</literal>) or a fully qualified domain name (e.g.,
|
||||
<literal>mydevice.example.com</literal>), following RFC 1123 naming conventions. Each label can be
|
||||
up to 63 characters, with a total maximum length of 253 characters for FQDNs. When this option is
|
||||
set, the DHCP server will include the hostname in DHCP replies (both OFFER and ACK) to the client
|
||||
with the matched MAC address.</para>
|
||||
|
||||
<para>The server automatically selects the appropriate DHCP option based on the hostname format:
|
||||
simple hostnames (single DNS label) are sent via option 12 (Host Name) per RFC 2132, while FQDNs
|
||||
with multiple labels are sent via option 81 (Client FQDN) per RFC 4702 using DNS wire format
|
||||
encoding. The configured hostname is sent unconditionally, any hostname requested by the client in
|
||||
its DHCP message is ignored.</para>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v259"/></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user