TechnitiumSoftware / DnsServer

Technitium DNS Server
https://technitium.com/dns/
GNU General Public License v3.0
3.84k stars 400 forks source link

Feature request: DHCP send hostname (Option 12) to client for reserved leases with specified hostname #816

Closed angzam78 closed 4 months ago

angzam78 commented 6 months ago

Hello,

Currently the DHCP server does not send a hostname (option 12) to a requesting client, even when there is a reserved lease with a hostname for that client and the client is explicitly requesting it. See dhcpdump below.

At the moment this limits the ability to automatically configure client hostnames through DHCP. If the DHCP server could send the reserved lease hostname to requesting clients then automatic client hostname configuration would be possible.

Therefore the feature request is to add DHCP option 12 to replies going to clients which have a reserved lease with a hostname.


When the client sends a request asking for a hostname...

  TIME: 2023-12-30 19:29:50.887
    IP: 0.0.0.0 (90:1b:e:b9:83:19) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 2b3ca366
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 90:1b:0e:b9:83:19:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         1 (DHCPDISCOVER)
OPTION:  12 (  6) Host name                 (none)
OPTION:  55 ( 13) Parameter Request List      1 (Subnet mask)
                         28 (Broadcast address)
                          2 (Time offset)
                          3 (Routers)
                         15 (Domainname)
                          6 (DNS server)
                        119 (Domain Search)
                         12 (Host name)
                         44 (NetBIOS name server)
                         47 (NetBIOS scope)
                         26 (Interface MTU)
                        121 (Classless Static Route)
                         42 (NTP servers)

---------------------------------------------------------------------------

The server does not currently reply with a host name even when there is a reserved lease with a hostname for that device:

  TIME: 2023-12-30 19:29:50.888
    IP: 192.168.1.100 (0:11:32:f4:96:a9) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 2 (BOOTPREPLY)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 2b3ca366
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 192.168.1.110
SIADDR: 192.168.1.100
GIADDR: 0.0.0.0
CHADDR: 90:1b:0e:b9:83:19:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         2 (DHCPOFFER)
OPTION:  54 (  4) Server identifier         192.168.1.100
OPTION:  51 (  4) IP address leasetime      86400 (24h)
OPTION:  58 (  4) T1                        43200 (12h)
OPTION:  59 (  4) T2                        75600 (21h)
OPTION:   1 (  4) Subnet mask               255.255.255.0
OPTION:  28 (  4) Broadcast address         192.168.1.255
OPTION:   3 (  4) Routers                   192.168.1.1
OPTION:  15 ( 19) Domainname                cluster.mydomain.net
OPTION:   6 (  4) DNS server                192.168.1.100
---------------------------------------------------------------------------
ShreyasZare commented 6 months ago

Thanks for the feedback. Yes, the DHCP server is currently not adding that option. Will update it to do that in the next release.

ShreyasZare commented 4 months ago

Technitium DNS Server v12 is now available which supports the hostname option. Do update and let me know your feedback.