[Dnsmasq-discuss] DNS from dhcp-host while client is offline

Petr Menšík pemensik at redhat.com
Tue Oct 5 08:27:13 UTC 2021


Hey,

On 10/4/21 14:37, Dominik Derigs wrote:
> Hey Petr,
>
> On Mon, 2021-10-04 at 11:45 +0200, Petr Menšík wrote:
>> Perhaps a flag could be added to dhcp-range, requesting also
>> addition of dhcp-hosts to static dns.
> Maybe this flag would better be set on --dhcp-host and --dhcp-
> hostsfile if this is used? This would feel more "natural" to me.
I wanted to avoid the need to specify it always per host. dhcp-hostsfile
would work also. Good idea. It might introduce limitation to used comma
character in accepted filenames. But I guess nobody would complain. Or
we could test just ",offline" suffix. dhcp-range has already some flags
to apply, hence I thought about that first. I admit it is not directly
related to mode of hosts.
>
> Initially, I've myself found this an odd behavior to only serve
> only DHCP host names that are known to be "alive". I do see some
> value in not serving A records when we know the server is
> offline, however, the very same happens on the Internet all the
> time: no DNS server I'm aware of checks if an A record is
> reachable before giving you the reply.

Sure, DNS server should not ping me before responding with my address.
However DHCP uses leases, host can acquire or release the lease, giving
the server clear idea when it might be available. Nothing similar exist
for DNS.

I admit fixed leases have no clear disadvantage to register the name all
the time. Their address would never be given to anyone else. I think ISC
DHCP uses DHCID record, which marks client owner of the lease. Maybe we
could implement it also, even when dnsmasq has such information
internally known. It might be used to get leased or only statically
defined difference from clients, if that information is considered
useful. Address records might be defined all the time.

> I've seen other systems using dnsmasq (it may or not have been
> DD-WRT, no promises!) that created two files from static leases:
> A dhcp-hostsfile and an addn-hosts file. Having an option to make
> the latter obsolete sounds like a good idea.
Sure, if we know it is already desired, we should make it possible.
Should be simple enough to implement.
>
> Best,
> Dominik
>
-- 
Petr Menšík
Software Engineer
Red Hat, http://www.redhat.com/
email: pemensik at redhat.com
PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB




More information about the Dnsmasq-discuss mailing list