<div dir="ltr">Hi list,<div><br></div><div>Currently, dnsmasq sets the DNS TTL for queries which it answers from local sources to 0 (or the value of --local-ttl). While this may be okay for entries out of /etc/hosts and addn-host files, it seems at least questionable for DHCP leases.</div><div><br></div><div>IMHO, a good DNS TTL for a DHCP lease would be the remaining duration of the lease (or half of that, since most DHCP clients renew their leases when half the lease time expired). Because many DHCP clients don't send a DHCPRELEASE when they disconnect from the network (either because they can't in case of wifi, or because they just don't), the DHCP server usually has no way invalidating a lease before it expires anyway.</div><div><br></div><div>I'd also love to have an option to set a DNS TTL per host-file entry, i.e. with a format like this:</div><div>1.2.3.4 host.domain.tld #3600</div><div>which would mean if the host line is followed by a comment which is a number, use that number in seconds as TTL for DNS responses.</div><div><br></div><div>The reason behind my request is the following: I have significant LAN traffic based on DNS, which results in unnecessary load on dnsmasq as it always responds with TTL 0 and thus prevents local caching. This also means that the entire LAN immediately "dies" if I the dnsmasq box isn't available even for a very short period (reboot). Setting --local-ttl is also not a feasible in my case because I have a backup internet connection, and one of my /etc/hosts entries points to the current external IP. This DNS response should go out with TTL 0. This way, the LAN clients can receive the new external IP immediately. By increasing --local-ttl, they'd get the "news" only after local-ttl seconds.</div><div><br></div><div>Any thoughts on my suggestions?</div><div><br></div><div>Thanks,</div><div>Lorin</div></div>