feat: specify skipped domains#366
Conversation
d50e047 to
9461681
Compare
|
@tnyeanderson, hello and thanks for the contribution. What exactly do you mean by "should be resolved locally"? As far as I can see, the introduced changes just add the ability to respond with ||domain.local^$dnsrewrite=NXDOMAINIf the purpose is to prevent non-local clients from resolving such domains, the ||domain.local^$client=~127.0.0.0/8|~192.168.0.0/16,dnsrewrite=NXDOMAINwill only allow resolving the |
|
Hi Eugene, the more I think about this, I think the goal should be to mimic the behavior of In other words, tell dnsproxy (and therefore adguardhome) that it should act as the authoritative nameserver for a particular domain/subdomain, so that DNS requests asking to resolve that domain (or its subdomains) will never be forwarded on to any other upstream nameserver. For answers known to adguardhome (through Of course this PR doesn't exactly do this at the moment, but I think it's a reasonable part of the DNS spec to implement, and meets my need better than my current shoehorned implementation. Before I switched to adguardhome, I was actually using dnsmasq and was using this |
9461681 to
7177922
Compare
7177922 to
5305dd4
Compare
|
Alright I finally got back around to working on this, I believe the tests pass (can you run the workflow to check?), and I've narrowed the scope a bit here. This PR adds syntax for skipping requests for certain domains and immediately responding NXDOMAIN: This will be useful for those who want to use dnsproxy with very limited "blocking" capabilities, but will also accomodate the use case where someone using AdGuardHome wants to ensure that their locally-configured domains (set with The "authoritative" piece of this has been dropped for now to keep things simple. Let me know if there's any adjustments I need to make here. Thanks! |
At the moment, it doesn't seem possible to specify that a domain (and its subdomains) should only ever be resolved locally.
There is
private_networkswhich works for in the opposite direction (ensures local IP reverse lookups are not recursed upstream). There is alsolocal_domain_namewhich is unfortunately a DHCP setting and seems to have no effect on this behavior (at least if DHCP is disabled as it is in my setup).This PR adds the ability to ensure that certain domains are treated as local-only and are never sent to any upstream servers for resolution. Essentially, it allows you to manage DNS for a local domain through AdGuardHome while ensuring that requests for non-existent subdomains aren't leaked to an upstream resolver.