-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the way PTR queries for local IP addresses are sent #2704
Comments
@ameshkov Hi I have MikroTik as DHCP server one for LAN and one for VLAN, for AdGuard Home get 2 IP Address from LAN and VLAN, 192.168.0.16 for LAN Interface, 10.5.50.16 for WiFi Interface, the problem is the WiFi Interface 10.5.50.16 always send PTR queries for local IP addresses both for LAN and WiFI subnet, if the second Instruction with |
Thanks for bringing all of these PTR related issues together, here are some more supplementary info that I think you might find useful:
Note: After some consideration, I think this is insufficient since a user might have multiple different subnets with different DHCP servers. Maybe we could do a blanket one that implies the rule above as that's what most users will likely use, and allow advanced users with more than one DHCP servers to set these up manually? Here's a poor mock-up I made by messing with the HTML 😛
IMHO AGH could disable this feature automatically if it detects the PTR requests are being looped back to itself. |
@wpehrc Interesting for my problem I now using static DNS on MikroTik router for the PTR request and I just released now on Clients (runtime) now showing my local client ip address, is that the right step? don't know, but this is enough for me |
@dioey I do not know about RouterOS but if you need to stop NetworkManager from messing with your resolv.conf, you need to set dns=none according to https://developer.gnome.org/NetworkManager/stable/NetworkManager.conf.html |
I am lost right there... Let's assume a simple/common/typical private network where you have one router and several clients, one of which is running AGH for the router and other local clients. In such a setup, the client running AGH is the local DNS resolver. What other resolver is there supposed to be? AGH should also change the "Data on the clients that use AdGuard Home, but not stored in the configuration" under I am also confused about the screenshot above showing "127.0.0.1 addresses" for Upstream DNS Servers. If AGH is running on 127.0.0.1, then wouldn't using the same 127.0.0.1 address for Upstream DNS Servers result in some infinite loop without any outbound WAN traffic? Does configuring the client that runs AGH with static ARP have an effect on AGH ARP function? For example, Raspberry Pi itself can be configured to use Static ARP, but then what of AGH ARP? |
Here's a simple example. Let's suppose:
On the openwrt device:
For whatever reason this user seem to be running unbound on their local device. I do not know why do they need unbound but doing this essentially throws out half of AGH's valuable features (DoH/DoT/DNSCyrpt) out of the window. |
@dioey Yes it looks correct. Please open a new issue if you need technical support. |
@EntropySmoke for |
Thanks. I sort of get it, but I only have a consumer router that fortunately allows me to specify custom DNS resolver IP, a local AGH-running device in this case. It's a good router, but with limited closed-source features and without allowing to flash DD-WRT firmware. I don't know if it is running DNSMasq or some proprietary daemon. The only DHCP option on it is to either get Public IP, Subnet Mask, and Gateway IP from ISP or to input values into those 3 fields manually. It does have a field for "Domain name". |
@wpehrc personally, I like your idea of adding a PTR resolver setting, but I'd better allow having multiple resolvers there, and also allow using "per-domain" syntax so that you could have something like this:
There's also a use case when AGH runs on a public server. In theory, public clients' hostnames need to be resolved via the "Upstream DNS servers", not the "PTR resolver". I am not sure how to make it clear to users UX-wise. |
How to tell whether PTR local host or PTR in-addr.arpa local client IP identifiers leaked upstream or not? Here's a set of screenshots when AdGuard DoH is the upstream DNS, AdGuard Home is DHCP Server, and local clients + router are added in Static Leases with host names: Was that PTR record sent upstream to AdGuard DNS with leaked identifying information (local IP address and/or local host name assigned in Static Leases)? |
Oh totally, I was not implying there should be only one resolver, that was just a simplified example. What I was trying to say was we should perhaps separate this out from the custom DNS rules to make this easier to configure.
Currently AGH is already sending PTR requests to the upstream resolver, the issue we have only concerns private networks, as in we should not forward PTR requests of private addresses to upstream public resolvers unless the user explicitly configured AGH to do so. (kind of like this: https://github.com/DNSCrypt/dnscrypt-proxy/blob/master/dnscrypt-proxy/example-dnscrypt-proxy.toml#L322 )
|
Re-assigned to v0.106 since this is a breaking change. |
Merge in DNS/adguard-home from 2704-local-addresses-vol.1 to master Updates #2704. Updates #2829. Updates #2846. Squashed commit of the following: commit 9a49b3d Author: Eugene Burkov <[email protected]> Date: Mon Mar 22 15:39:17 2021 +0300 aghnet: imp docs and logging commit 74f95a2 Author: Eugene Burkov <[email protected]> Date: Fri Mar 19 20:56:51 2021 +0300 all: fix friday evening mistakes commit 0e2066b Author: Eugene Burkov <[email protected]> Date: Fri Mar 19 20:51:15 2021 +0300 all: upd testify, imp code quality commit 8237c50 Author: Eugene Burkov <[email protected]> Date: Fri Mar 19 20:19:29 2021 +0300 aghnet: imp test naming commit 14eb1e1 Author: Eugene Burkov <[email protected]> Date: Fri Mar 19 19:41:43 2021 +0300 aghnet: isolate windows-specific functionality commit d461ac8 Author: Eugene Burkov <[email protected]> Date: Fri Mar 19 14:50:05 2021 +0300 aghnet: imp code quality commit d0ee01c Author: Eugene Burkov <[email protected]> Date: Fri Mar 19 11:59:10 2021 +0300 all: mv funcs to agherr, mk system resolvers getter
Hello everyone! We've came up with a little update. The syntax of upstreams for resolving PTRs for local addresses is now fully equivalent to usual upstreams' field. The feature is now useful and works completely as it was designed. |
I have the latest edge build installed... if I put these meross devices in the static dhcp list, it works fine... but still get this timeout for IP addresses not yet assigned. |
@zadigre, the edge build was still going when Eugene wrote that comment. Sorry for the confusion. The actual build with the feature should be out now. |
good! works fine now... no timeout... I get a servefail for non existing PTR work now. only "bug" is now for my meross device... if I do nslookup on the IP address, I get the servfail even if dhcp lease is present... if I put the MAC address and IP address in the static list, all is fine. |
I may have found the cause of this problem... |
@zadigre, thanks for the report. Weird behaviour from that device. Unless it's urgent, we'll try to fix it closer on Monday, as most of our team has already signed off for the weekend. Until then, the static lease solution is probably the best workaround. |
for sure, it's not urgent. thank you! |
Merge in DNS/adguard-home from 1868-rdns-ipv6 to master Updates #2943. Updates #2704. Squashed commit of the following: commit 53d67ec Author: Eugene Burkov <[email protected]> Date: Tue Apr 13 16:18:33 2021 +0300 all: imp code, docs commit 2bc1594 Author: Eugene Burkov <[email protected]> Date: Tue Apr 13 16:09:08 2021 +0300 all: imp code
The new system appears to be even more confusing. Setup:
I am not hosting any services over WAN, not running AGH as public server, only use AGH for local clients, but I do use AGH for WAN DNS to block router-specific requests. What address should I use for the new "Private DNS Servers"? 127.0.0.1? 10.0.0.0? If I use 127.0.0.1 for "Private DNS Servers" and run "Test Upstreams", I do get a 1.0.0.127 PTR response, but there is no PTR response if I use router 10.0.0.0 address "Private DNS Servers". Previous AGH version shows a single PTR response resolution for my public IP address whenever my ISP assigns me a new public IP address. New AGH version shows NXDOMAIN whenever my ISP assigns me a new public IP address. Which AGH version displays correct behavior for my configuration, where AGH is DNS server for LAN clients and WAN? |
If AGH on the Pi is the DHCP server of the network, and all clients are listed in the I'm not sure I understand the second question, sorry. Do you mean that the PTR queries that come from your private network and request information about the public IP of the WAN Router return results that are different from the previous version? Because the behaviour of such queries shouldn't change, and we should still forward them to the upstreams. |
|
If none of that helps, please file a new issue or discussion with a link to this one. Thanks. |
Just to provide some feedback, the new Private DNS Servers (PTR) functionality that was added in 0.106.0-b.2 is working perfectly for me so far - it's fix the Bonjour issues I was seeing. Thanks for the great work |
|
Hi All, |
@ShlomiD83, judging by your setup, this field should contain the address of your router (which is DHCP in your network). But you may also leave it empty, because AGH should get it automatically. |
Ok, thank you. |
What AGH needs is:
A bit off-topic, but is there an advantage to using PTR instead of etc/hosts file in a system where all LAN IP's are static? is it more secure to use DHCP Static Leases with PTR rather using DHCP Static Leases with etc/hosts assignments? I also noticed that when AGH is DHCP with Static Leases (and etc/hosts file does not list clients), my LAN clients show ARP as source, but WLAN clients show DHCP as source even when WLAN devices have static IP's assigned in their device settings. |
Merge in DNS/adguard-home from 2704-local-addresses-vol.1 to master Updates AdguardTeam#2704. Updates AdguardTeam#2829. Updates AdguardTeam#2846. Squashed commit of the following: commit 9a49b3d Author: Eugene Burkov <[email protected]> Date: Mon Mar 22 15:39:17 2021 +0300 aghnet: imp docs and logging commit 74f95a2 Author: Eugene Burkov <[email protected]> Date: Fri Mar 19 20:56:51 2021 +0300 all: fix friday evening mistakes commit 0e2066b Author: Eugene Burkov <[email protected]> Date: Fri Mar 19 20:51:15 2021 +0300 all: upd testify, imp code quality commit 8237c50 Author: Eugene Burkov <[email protected]> Date: Fri Mar 19 20:19:29 2021 +0300 aghnet: imp test naming commit 14eb1e1 Author: Eugene Burkov <[email protected]> Date: Fri Mar 19 19:41:43 2021 +0300 aghnet: isolate windows-specific functionality commit d461ac8 Author: Eugene Burkov <[email protected]> Date: Fri Mar 19 14:50:05 2021 +0300 aghnet: imp code quality commit d0ee01c Author: Eugene Burkov <[email protected]> Date: Fri Mar 19 11:59:10 2021 +0300 all: mv funcs to agherr, mk system resolvers getter
Merge in DNS/adguard-home from 2704-local-addresses-vol.2 to master Updates AdguardTeam#2704. Updates AdguardTeam#2829. Squashed commit of the following: commit 507d038 Author: Eugene Burkov <[email protected]> Date: Wed Mar 31 14:33:05 2021 +0300 aghtest: fix file name commit 8e19f99 Author: Eugene Burkov <[email protected]> Date: Wed Mar 31 14:06:43 2021 +0300 aghnet: rm redundant mutexes commit 361fa41 Author: Eugene Burkov <[email protected]> Date: Wed Mar 31 13:45:30 2021 +0300 all: fix names, docs commit 14034f4 Merge: 35e265c a72ce1c Author: Eugene Burkov <[email protected]> Date: Wed Mar 31 13:38:15 2021 +0300 Merge branch 'master' into 2704-local-addresses-vol.2 commit 35e265c Author: Eugene Burkov <[email protected]> Date: Wed Mar 31 13:33:35 2021 +0300 aghnet: imp naming commit 7a7edac Author: Eugene Burkov <[email protected]> Date: Tue Mar 30 20:59:54 2021 +0300 changelog: oops, nope yet commit d26a5d2 Author: Eugene Burkov <[email protected]> Date: Tue Mar 30 20:55:53 2021 +0300 all: some renaming for the glory of semantics commit 9937fa6 Author: Eugene Burkov <[email protected]> Date: Mon Mar 29 15:34:42 2021 +0300 all: log changes commit d8d9e6d Author: Eugene Burkov <[email protected]> Date: Fri Mar 26 18:32:23 2021 +0300 all: imp localresolver, imp cutting off own addresses commit 344140d Author: Eugene Burkov <[email protected]> Date: Fri Mar 26 14:53:33 2021 +0300 all: imp code quality commit 1c5c0ba Author: Eugene Burkov <[email protected]> Date: Thu Mar 25 20:44:08 2021 +0300 all: fix go.mod commit 0b9fb3c Author: Eugene Burkov <[email protected]> Date: Thu Mar 25 20:38:51 2021 +0300 all: add error handling commit a7a2e51 Merge: c13be63 27f4f05 Author: Eugene Burkov <[email protected]> Date: Thu Mar 25 19:48:36 2021 +0300 Merge branch 'master' into 2704-local-addresses-vol.2 commit c13be63 Author: Eugene Burkov <[email protected]> Date: Thu Mar 25 18:52:28 2021 +0300 all: cover rdns with tests, imp aghnet functionality commit 48bed90 Author: Eugene Burkov <[email protected]> Date: Wed Mar 24 20:18:07 2021 +0300 home: make rdns great again commit 1dbacfc Author: Eugene Burkov <[email protected]> Date: Wed Mar 24 16:07:52 2021 +0300 all: imp external client restriction commit 1208a31 Author: Eugene Burkov <[email protected]> Date: Mon Mar 22 15:26:45 2021 +0300 all: finish local ptr processor commit c8827fc Author: Eugene Burkov <[email protected]> Date: Tue Mar 2 13:41:22 2021 +0300 all: imp ipdetector, add local ptr processor
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master Updates AdguardTeam#2704. Updates AdguardTeam#2829. Updates AdguardTeam#2928. Squashed commit of the following: commit 8c42355 Author: Eugene Burkov <[email protected]> Date: Wed Apr 7 18:07:41 2021 +0300 dnsforward: rm errors pkg commit 7594a21 Merge: 830b083 908452f Author: Eugene Burkov <[email protected]> Date: Wed Apr 7 18:00:03 2021 +0300 Merge branch 'master' into 2704-local-addresses-vol.3 commit 830b083 Author: Eugene Burkov <[email protected]> Date: Wed Apr 7 17:47:51 2021 +0300 dnsforward: reduce local upstream timeout commit 493e81d Author: Ildar Kamalov <[email protected]> Date: Tue Apr 6 19:11:00 2021 +0300 client: private_upstream test commit a0194ac Author: Eugene Burkov <[email protected]> Date: Tue Apr 6 18:36:23 2021 +0300 all: expand api, fix conflicts commit 0f4e068 Merge: 89cf93a 8746005 Author: Eugene Burkov <[email protected]> Date: Tue Apr 6 18:35:04 2021 +0300 Merge branch 'master' into 2704-local-addresses-vol.3 commit 89cf93a Author: Ildar Kamalov <[email protected]> Date: Tue Apr 6 18:02:40 2021 +0300 client: add local ptr upstreams to upstream test commit e6dd869 Author: Ildar Kamalov <[email protected]> Date: Tue Apr 6 15:24:22 2021 +0300 client: add private DNS form commit b858057 Author: Eugene Burkov <[email protected]> Date: Tue Apr 6 13:05:28 2021 +0300 aghstrings: mk cloning correct commit 8009ba6 Author: Eugene Burkov <[email protected]> Date: Tue Apr 6 12:37:46 2021 +0300 aghstrings: fix lil bug commit 0dd19f2 Author: Eugene Burkov <[email protected]> Date: Mon Apr 5 20:45:01 2021 +0300 all: log changes commit eb5558d Author: Eugene Burkov <[email protected]> Date: Mon Apr 5 20:18:53 2021 +0300 dnsforward: keep the style commit d6d5fcb Author: Eugene Burkov <[email protected]> Date: Mon Apr 5 20:02:52 2021 +0300 dnsforward: disable redundant filtering for local ptr commit 4f864c3 Author: Eugene Burkov <[email protected]> Date: Mon Apr 5 17:53:17 2021 +0300 dnsforward: imp tests commit 7848e6f Author: Eugene Burkov <[email protected]> Date: Mon Apr 5 14:52:12 2021 +0300 all: imp code commit 19ac306 Author: Eugene Burkov <[email protected]> Date: Sun Apr 4 16:28:05 2021 +0300 all: mv more logic to aghstrings commit fac892e Author: Eugene Burkov <[email protected]> Date: Fri Apr 2 20:23:23 2021 +0300 dnsforward: use filepath commit 05a3aee Author: Eugene Burkov <[email protected]> Date: Fri Apr 2 20:17:54 2021 +0300 aghstrings: introduce the pkg commit f24e1b6 Author: Eugene Burkov <[email protected]> Date: Fri Apr 2 20:01:23 2021 +0300 all: imp code commit 0217a0e Author: Eugene Burkov <[email protected]> Date: Fri Apr 2 18:04:13 2021 +0300 openapi: log changes ... and 3 more commits
Updates AdguardTeam#2704. Squashed commit of the following: commit bbc292a Author: Eugene Burkov <[email protected]> Date: Fri Apr 9 19:22:46 2021 +0300 all: replace exchanger with proxy
Merge in DNS/adguard-home from 1868-rdns-ipv6 to master Updates AdguardTeam#2943. Updates AdguardTeam#2704. Squashed commit of the following: commit 53d67ec Author: Eugene Burkov <[email protected]> Date: Tue Apr 13 16:18:33 2021 +0300 all: imp code, docs commit 2bc1594 Author: Eugene Burkov <[email protected]> Date: Tue Apr 13 16:09:08 2021 +0300 all: imp code
Currently, we ask people to use this instruction in order to re-route local PTR queries to the proper DNS server. This is not an ideal solution and we can do this automatically.
Here's what we should do.
AdGuardHome.yaml
./etc/resolv.conf
. In light of this, we should make sure to not send those queries to AGH itself.The text was updated successfully, but these errors were encountered: