AdguardTeam / AdGuardHome

Network-wide ads & trackers blocking DNS server
https://adguard.com/adguard-home.html
GNU General Public License v3.0
23.61k stars 1.73k forks source link

PTR ttl value for local hosts not respects dhcp lease time #3932

Open alexeys85 opened 2 years ago

alexeys85 commented 2 years ago

Prerequisites

Issue Details

Expected Behavior

PTR ttl values respect dhcp lease time for local hosts

Actual Behavior

PTR ttl value is always 10. A a result some hosts (Aruba AP11 access point) generate PTR requests every 10 seconds spamming the query log. Screenshot

Additional Information

I use AdGuardHome as only a DNS server and preinstalled dnsmasq and DHCP server. Some of my local hosts in my home network has static leases with lease time 7 days which I clearly see in /tmp/dhcp.leases file. For example: 1639872243 xx:xx:xx:xx:xx:xx 192.168.1.4 Aruba xx:xx:xx:xx:xx:xx which is more than 6 days from now.

Is it possible for AdGuardHome to use this file with right ttl values when forming PTR answers? Or may be there is any other workaround?

ainar-g commented 2 years ago

Hello! This TTL is controlled by the (rather badly named) blocked_response_ttl setting. The default value is low so that if you, say, unblock a domain, the clients will see the change quicker.

Which TTL to use for DHCP leases is a tricky question, since technically leases can be deleted or reset, and you probably don't want clients to cache the value for a long time.

alexeys85 commented 2 years ago

Which TTL to use for DHCP leases is a tricky question, since technically leases can be deleted or reset, and you probably don't want clients to cache the value for a long time.

Well, that's true. But may be you have plans to support dhcp.leases file to determine lease time?

ainar-g commented 2 years ago

We'll consider the options here, yes.

alexeys85 commented 2 years ago

Perfect, thanks!