DHCPv4 scope without gateway or DNS

Started by Hypocrisy7186, May 07, 2023, 12:39:06 PM

Previous topic - Next topic
Hi I'm attempting to set up a DHCP scope for a network where I only want to allocate IP addresses. I can see I can set the gateway to "none" but I can't find away not to allocate DNS servers or DNS search suffix. Is this possible?

I don't see a way to do that with the included DHCP server. Just set DNS to 192.0.2.1 (RFC 1166 unusable address).

Considering your hosts will have no gateway, they will instantly see no possible route to that address, which should cause connection attempts to instantly fail without a single packet ever leaving the NIC.


May 18, 2023, 08:50:16 AM #3 Last Edit: May 18, 2023, 08:52:51 AM by Hypocrisy7186
Well it turned out that 192.0.2.1 did cause slow DNS for me as I hadn't considered instances that had network connections in to this network and then another network that had a default gateway. This then cause the 192.0.2.1 DNS server to be used from the DHCP network but then attempt to route out of network that had a default gateway. This then led to DNS resolution delays while this timed out.

I tried changing the DNS server to 127.0.0.255, the thinking being that my local resolver listens on 127.0.0.53 so it would fail quicker but it actually cause the DNS servers not to be applied. I'm not sure if its the DHCP server not publishing or my systems ignoring the loopback DNS config but either way its now working as I wanted.

So to summarise. If you want a DHCPv4 scope that only gives out IP addresses and not a gateway or DNS server(s) then setting the gateway to "none" and DNS to "127.0.0.255" worked for me.