AdguardTeam / AdGuardHome

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

Set separate TTL for DNS rewrites #1518

Open emlimap opened 4 years ago

emlimap commented 4 years ago

Problem Description

At the moment DNS rewrites have the same TTL as blocked query. Which is 10 seconds by default. The problem with this approach is that 10 seconds is too low, generates lot more queries, clutters up query log and isn't efficient overall.

Workaround is to set blocked_response_ttl to higher value in the config file but that would mean you will have to wait longer whenever a domain is whitelisted in the web gui for browser/client OS DNS cache to time out.

Proposed Solution

One solution would be is to add another config parameter like dns_rewrite_ttl and set the default to say 300 seconds. Rewrites aren't going to change frequently and also something that is manually added by user. This might not need to be exposed in the web gui like how blocked response ttl isn't.

Alternatives Considered

  1. set blocked_response_ttl in config file to a higher value.
  2. Use separate DNS server for rewrites like dnsmasq or unbound.
Elkropac commented 2 years ago

This would be useful, i got 9 million of queries per week from home assistant, checking all my smart devices

mada199122 commented 1 year ago

any news about this?

Pikey18 commented 1 year ago

This is something that would be a useful enhancement.

I agree with the separate line in the config file and a default of 300.

No idea if its a complicated addition but hope it can happen.

mxbchr commented 11 months ago

+1 for this

mada199122 commented 10 months ago

+1 for this too

ameshkov commented 10 months ago

I'd prefer to extend $dnsrewrite with an option to specify TTL

ainar-g commented 10 months ago

@ameshkov, that is an okay separate feature, but it's really not a complete solution, for the following reasons:

tipuraneo commented 8 months ago

I am facing this issues too. Is there a timeline to for a solution?

Honusnap commented 7 months ago

Hello all,

Would like to be able to say : For this name just authorize one call per day ... per week .. per minute ... Like some guys here, i got many calls in Home Assistant for example but also on some other devices that call home or even call to check updates... those app got no parameters on how much they can check those updates .. and frankly, checking every hours is nuts. Thanks

kelke commented 6 months ago

Me too, uptime-kuma in particular is clogging up the log and statistics heavily. A seperate ttl in DNS settings would be ideal in mind as well

candybars2021 commented 4 months ago

I realize this is an old topic, but just wanted to add that reverse private queries (with actual accurate result of device name), don't get cached at all, and ttl is not extended to the minimum set, as it should. My firewall returns 0 second for RTP, so my MacBook is unable to publish its network name as it expires before the response is given, sends 10 request a second, and this is one device. Without blocking important services, this is 100ks of queries that are futile a day. Lack of override and lack of cache on legit and permanent result (never changed my home devices names) response is too much to bare...