Skip to content
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

DNS64/NAT64 Support in AdGuardHome? #5117

Closed
3 tasks done
gtxaspec opened this issue Nov 7, 2022 · 10 comments
Closed
3 tasks done

DNS64/NAT64 Support in AdGuardHome? #5117

gtxaspec opened this issue Nov 7, 2022 · 10 comments

Comments

@gtxaspec
Copy link

gtxaspec commented Nov 7, 2022

Prerequisites

  • I have checked the Wiki and Discussions and found no answer

  • I have searched other issues and found no duplicates

  • I want to request a feature or enhancement and not ask a question

Description

Hello,

Didn't see this in any documentation, or in any previously opened issues or discussions. Tested with latest AGH Edge release.

Regarding DNS64 support in AGH, I have IPv6 only clients (ex. 2001:db8:beef:4000::1), whom can access IPv4 hosts via a NAT64 jool translator (2001:db8:beef:4::/96).

Traditionally, We would use bind9 to specify a translator in named.conf.options, such as (dns64 2001:db8:beef:4::/96 { clients { !translator; dns64-good-clients; }; };

The IPv6 only clients would then be able to query the DNS server, and if presented with a DNS entry that was IPv4 ONLY, the response would be 2001:db8:beef:4:8.8.8.8 for example.

I would ideally wish to replace bind9 with AdGuardHome.

The question now is, does AdGuardHome support DNS64/NAT64? If it does, how would it be configured? If it does not, this would be a great feature to add to the existing features.

Thanks!

@gtxaspec gtxaspec changed the title DNS64/NAT64 Support in AdGuardHome DNS64/NAT64 Support in AdGuardHome? Nov 7, 2022
@jdreskell
Copy link

Following. I used the guide at https://www.jool.mx/en/dns64.html to do this setup. I'd like to use AGH instead of bind to serve my network.

@gtxaspec
Copy link
Author

gtxaspec commented Dec 3, 2022

Looks like this issue has been visited on the other AdGuard products:
AdGuard IOS: AdguardTeam/AdguardForiOS#796
AdGuard Android: AdguardTeam/AdguardForAndroid#1884 (comment)
AdGuard dnsproxy: AdguardTeam/dnsproxy#40

@ameshkov @ainar-g would you be able to look into this for AGH too? =D

@ameshkov
Copy link
Member

ameshkov commented Dec 4, 2022

DNS64 is already supported by dnsproxy which AdGuard Home uses under the hood. So this task may be split in two parts: expose DNS64 prefix setting via AdGuardHome.yaml (can be done relatively quickly) and expose it via the UI (later).

@gtxaspec
Copy link
Author

gtxaspec commented Dec 8, 2022

@ameshkov great to hear! I look forward to a future release sometime =D

@jdreskell
Copy link

Wonderful News! @ameshkov is there a release version this would be planned in? Cheers!

@ainar-g ainar-g added this to the v0.107.21 milestone Dec 12, 2022
adguard pushed a commit that referenced this issue Jan 23, 2023
Merge in DNS/adguard-home from 5117-dns64 to master

Updates #5117.

Squashed commit of the following:

commit 757d689
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Jan 23 19:06:18 2023 +0300

    all: imp fmt

commit b7a73c6
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Jan 23 17:49:21 2023 +0300

    all: rm unused, imp code

commit 548feb6
Merge: de3e84b 54a141a
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Jan 23 14:08:12 2023 +0300

    Merge branch 'master' into 5117-dns64

commit de3e84b
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Jan 23 12:04:48 2023 +0300

    dnsforward: imp code

commit a580e92
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Jan 20 18:24:33 2023 +0400

    dnsforward: try again

commit 67b7a36
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Jan 20 18:08:23 2023 +0400

    dnsforward: fix test on linux

commit ca83e41
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Jan 20 17:37:48 2023 +0400

    dnsforward: imp naming

commit c4e477c
Merge: 42aa42a 6e80337
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Jan 20 17:30:03 2023 +0400

    Merge branch 'master' into 5117-dns64

commit 42aa42a
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Jan 20 17:26:54 2023 +0400

    dnsforward: imp test

commit 4e91c67
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Wed Jan 18 12:32:55 2023 +0400

    dnsforward: imp code, docs, add test

commit 766ef75
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue Jan 17 16:36:35 2023 +0400

    dnsforward: imp docs

commit 6825f37
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue Jan 17 14:33:33 2023 +0400

    internal: imp code, docs

commit 1215316
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Jan 13 21:24:50 2023 +0400

    all: add dns64 support
@gtxaspec
Copy link
Author

tested latest master, working well. can't wait for this to be introduced into the UI =D

@rapdodge
Copy link

^ same
tested on v0.108.0-a.421+d52f1d0e, working great, waiting to be implemented via webui :D

Server:  alpine-agsmartdns
Address:  192.168.1.130

Non-authoritative answer:
Name:    github.com
Addresses:  64:ff9b::14cd:f3a6
          20.205.243.166

@ainar-g ainar-g modified the milestones: v0.107.24, v0.107.23 Feb 1, 2023
adguard pushed a commit to AdguardTeam/dnsproxy that referenced this issue Feb 6, 2023
Merge in DNS/dnsproxy from 5117-backport-dns64 to master

Updates AdguardTeam/AdGuardHome#5117.

Squashed commit of the following:

commit 7fcd7d8
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Feb 3 15:03:17 2023 +0300

    proxy: fix test

commit ec1b3d7
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Feb 3 14:00:42 2023 +0300

    proxy: imp docs

commit eb0b1e3
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Feb 2 20:08:40 2023 +0300

    proxy: imp and test

commit d4b9133
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Feb 2 17:40:56 2023 +0300

    proxy: fix race in test

commit ef90bd3
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Feb 2 15:33:04 2023 +0300

    proxy: fit gocyclo into 10, imp logs

commit 0e25eb6
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Feb 2 14:01:12 2023 +0300

    all: imp code, tests

commit a58f2f2
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Wed Feb 1 14:35:30 2023 +0300

    proxy: fix const name

commit 266095a
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Wed Feb 1 14:31:11 2023 +0300

    proxy: rm unused, exp const

commit ccafca5
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Wed Feb 1 13:41:19 2023 +0300

    proxy: backport dns64, depr old api
adguard pushed a commit that referenced this issue Feb 6, 2023
Merge in DNS/adguard-home from 5117-backport-dns64 to master

Updates #5117.

Squashed commit of the following:

commit 8ac8853
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Feb 6 16:44:16 2023 +0300

    all: rm todos

commit 0aa66c5
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Feb 6 15:40:38 2023 +0300

    all: upd dnsproxy

commit 872a8ef
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Feb 3 14:14:21 2023 +0300

    dnsforward: imp docs

commit 8efeb42
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Wed Feb 1 02:58:01 2023 +0300

    all: rm dns64
@EugeneOne1
Copy link
Member

@gtxaspec, @jdreskell, @rapdodge, hello. We've filled the separate issue (#5460) about exposing the setting to UI. We'll close this issue for now, so please upvote and track the mentioned one.

heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Merge in DNS/adguard-home from 5117-dns64 to master

Updates AdguardTeam#5117.

Squashed commit of the following:

commit 757d689
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Jan 23 19:06:18 2023 +0300

    all: imp fmt

commit b7a73c6
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Jan 23 17:49:21 2023 +0300

    all: rm unused, imp code

commit 548feb6
Merge: de3e84b 54a141a
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Jan 23 14:08:12 2023 +0300

    Merge branch 'master' into 5117-dns64

commit de3e84b
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Jan 23 12:04:48 2023 +0300

    dnsforward: imp code

commit a580e92
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Jan 20 18:24:33 2023 +0400

    dnsforward: try again

commit 67b7a36
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Jan 20 18:08:23 2023 +0400

    dnsforward: fix test on linux

commit ca83e41
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Jan 20 17:37:48 2023 +0400

    dnsforward: imp naming

commit c4e477c
Merge: 42aa42a 6e80337
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Jan 20 17:30:03 2023 +0400

    Merge branch 'master' into 5117-dns64

commit 42aa42a
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Jan 20 17:26:54 2023 +0400

    dnsforward: imp test

commit 4e91c67
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Wed Jan 18 12:32:55 2023 +0400

    dnsforward: imp code, docs, add test

commit 766ef75
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue Jan 17 16:36:35 2023 +0400

    dnsforward: imp docs

commit 6825f37
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue Jan 17 14:33:33 2023 +0400

    internal: imp code, docs

commit 1215316
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Jan 13 21:24:50 2023 +0400

    all: add dns64 support
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Merge in DNS/adguard-home from 5117-backport-dns64 to master

Updates AdguardTeam#5117.

Squashed commit of the following:

commit 8ac8853
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Feb 6 16:44:16 2023 +0300

    all: rm todos

commit 0aa66c5
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Feb 6 15:40:38 2023 +0300

    all: upd dnsproxy

commit 872a8ef
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Feb 3 14:14:21 2023 +0300

    dnsforward: imp docs

commit 8efeb42
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Wed Feb 1 02:58:01 2023 +0300

    all: rm dns64
@Srylax
Copy link

Srylax commented Nov 18, 2023

I can't get this to work when the domain returns a CNAME:

dig AAAA ipv4.google.com

; <<>> DiG 9.10.6 <<>> AAAA ipv4.google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40352
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;ipv4.google.com.		IN	AAAA

;; ANSWER SECTION:
ipv4.google.com.	300	IN	CNAME	ipv4.l.google.com.

;; AUTHORITY SECTION:
l.google.com.		2	IN	SOA	ns1.google.com. dns-admin.google.com. 583327338 900 900 1800 60

;; Query time: 60 msec
;; SERVER: 2001:XXXX:XXXX:XXXX::2#53(2001:XXXX:XXXX:XXXX::2) 
;; WHEN: Sat Nov 18 15:29:19 CET 2023
;; MSG SIZE  rcvd: 115

here with cloudflares dns64 server:
dig @2606:4700:4700::64 AAAA ipv4.google.com

; <<>> DiG 9.10.6 <<>> @2606:4700:4700::64 AAAA ipv4.google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56134
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;ipv4.google.com.		IN	AAAA

;; ANSWER SECTION:
ipv4.google.com.	123	IN	CNAME	ipv4.l.google.com.
ipv4.l.google.com.	123	IN	AAAA	64:ff9b::acd9:a82e

;; Query time: 53 msec
;; SERVER: 2606:4700:4700::64#53(2606:4700:4700::64)
;; WHEN: Sat Nov 18 15:31:11 CET 2023
;; MSG SIZE  rcvd: 93

When I query ipv4.l.google.comwith dig it successfully returns the dns64 mapping but when I query ipv4.google.com via chromes net-internals it gives this response:

Resolved IP addresses of "ipv4.google.com": ["142.250.203.110"].
No alternative endpoints.

adguard query log:

15:35:56
ipv4.google.com
Type: AAAA, Plain DNS
Response:
CNAME: ipv4.l.google.com. (ttl=248)

15:35:55
ipv4.google.com
Type: A, Plain DNS
Response: 
CNAME: ipv4.l.google.com. (ttl=248)
A: 142.250.203.110 (ttl=248)

15:35:55
ipv4.google.com
Type: HTTPS, Plain DNS
Response: CNAME: ipv4.l.google.com. (ttl=7)

@Srylax
Copy link

Srylax commented Nov 19, 2023

Ok so turns out UDM is rewriting when the ad blocking feature is on: https://help.ui.com/hc/en-us/articles/9794438523799
This fucks up dns64...
With it turned off it works perfectly.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants