Specify DHCP option for ntp-server in Pihole FTL

Please follow the below template, it will help us to help you!

Expected Behaviour:

Pihole-FTL DHCP server provides the ntp-server option (option 42) in the DHCP response.
I am running Pihole 4.3.1 in a docker container. I have a file named /etc/dnsmasq.d/42-pihole-dhcp-ntp.conf which consists of the following two lines. I've alternated between them, but get the same behavior. I've even tried putting the IP in quotes, but then Pihole error'ed out and wouldn't load because it couldn't parse the config file, so I know it's getting loaded and I know the syntax is acceptable. (The x.x.x.x is replaced with my actual NTP server address in the file.)

dhcp-option=option:ntp-server,x.x.x.x
dhcp-option=42,x.x.x.x

I have also tried adding it to /etc/dnsmasq.d/02-pihole-dhcp.conf just to see if it would work, and it did not.
The closest I have come to getting it working was manually running this command (but I feel there's a better way):

pihole-FTL -- -O 42,x.x.x.x

Actual Behaviour:

Pihole-FTL DHCP sends other DHCP options, but not 42 in the DHCP response.

Debug Token:

40xup2ftpd

What is the error you get when you use the config?

When I include the quotes around the IP address, I get a syntax error. That was my way of making sure that the line in the /etc/dnsmasq.d/42-pihole-dhcp-ntp.conf file was being loaded.
Once I revert back to the config I posted where the IP address is not surrounded by quotes, there are no errors, it simply doesn't include option 42 in the DHCP response.

I dont think your doing anything wrong:

pi@noads:~ $ echo 'dhcp-option=42,11.22.33.44' | sudo tee /etc/dnsmasq.d/42-pihole-dhcp-ntp.conf
dhcp-option=42,11.22.33.44

pi@noads:~ $ sudo service pihole-FTL reload
pi@noads:~ $

dehakkelaar@laptop:~$ sudo nmap -sU -p67 --script dhcp-discover 10.0.0.2

Starting Nmap 7.40 ( https://nmap.org ) at 2019-07-17 17:55 CEST
Nmap scan report for noads.dehakkelaar.nl (10.0.0.2)
Host is up (0.0013s latency).
PORT   STATE SERVICE
67/udp open  dhcps
| dhcp-discover:
|   DHCP Message Type: DHCPACK
|   Server Identifier: 10.0.0.2
|   IP Address Lease Time: 23h56m42s
|   Subnet Mask: 255.255.255.0
|   Broadcast Address: 10.0.0.255
|   Domain Name Server: 10.0.0.2
|   Domain Name: dehakkelaar.nl
|   NTP Servers: 11.22.33.44
|_  Router: 10.0.0.1
MAC Address: B8:27:EB:68:xx:xx (Raspberry Pi Foundation)

Nmap done: 1 IP address (1 host up) scanned in 1.94 seconds

How have you determined this ?
And did you renew DHCP lease on the clients after adding the 42 option ?

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.