I'm trying to host a DNS and DHCP service with dnsmasq. Here is my dnsmasq.conf



dhcp-host=0a:0a:0a:0a:0a:01,  # node.local

no-hosts # ignore etc hosts

When I do look at the ports being listened with: sudo ss -tulpn | grep LISTEN I only see the :53, DNS port being listened to. Port 67 is not being listened on, so it doesn't seem like the DHCP service is running.

Is the DHCP running? and If so, will clients be able to get IP addresses if I'm only listening on port 53, and not the default DHCP port?


1 Answer 1


An IPv4 DHCP server will need to be able to send & receive broadcast packets addressed to destination, which requires (as far as I know) the use of a raw socket.

See ss -A raw -lpn to find the DHCP server's raw socket. Since it works at the level of raw IP protocol, the socket won't be specific to port 67: the DHCP server will have to build the UDP headers on its own on outgoing packets, including putting in the port number.

For incoming packets, if it was listening for UDP port 67 in the normal way, the kernel would discard some packets the DHCP server wants to receive as "misconfigured" - precisely because the DHCP client might not have a valid network configuration yet! Or the client might be unaware that it has been plugged into a different network while powered off, and might start trying to validate its old DHCP lease using network parameters that are incorrect for the new network - ideally the DHCP server needs to be able to hear this and send a DHCP NAK to such a client to tell it to forget the old address and start the DHCP process over.

So, the DHCP server needs to listen for incoming UDP packets using a raw socket, to also accept some incoming packets the normal network driver stack would reject. Because of this, ss -tulpn | grep LISTEN won't show such a socket. In effect, the kernel does not really know what the DHCP server is listening for, as using a raw socket is equivalent to telling the kernel "give me a copy of any incoming IP packets, I'll search myself for the specific things that interest me."

  • Thanks for your response. So if I understood correctly, the server doesn't need to be listening on port 67 to function normally as a dhcp server?
    – qMo
    Commented Sep 25, 2022 at 17:50
  • 1
    See my edit above. In short, the DHCP server is listening for traffic addressed to UDP port 67, but in a way that is not visible to ss -tulpn | grep LISTEN.
    – telcoM
    Commented Sep 25, 2022 at 18:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .