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

Allow choosing IP version preference for upstream servers #4262

Closed
3 tasks done
uenokatsura opened this issue Feb 8, 2022 · 19 comments
Closed
3 tasks done

Allow choosing IP version preference for upstream servers #4262

uenokatsura opened this issue Feb 8, 2022 · 19 comments

Comments

@uenokatsura
Copy link

Prerequisites

Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

Issue Details

  • Version of AdGuard Home server:
    v0.107.3
  • How did you install AdGuard Home:
    GitHub releases
  • How did you setup DNS configuration:
    System
  • CPU architecture:
    AMD64
  • Operating system and version:
    Windows 10 21H2

Expected Behavior

Adguard Home communicate with Google DNS(DoT/DoH) in IPv6

Actual Behavior

It just ignore the AAAA record and request with IPv4

@ainar-g
Copy link
Contributor

ainar-g commented Feb 9, 2022

Hello. What exactly is the issue you're dealing with? The current algorithm prioritizes IPv4 addresses over IPv6 ones because situations where IPv4 is available but IPv6 isn't are more common than the reverse.

@ainar-g ainar-g added the waiting for data Waiting for users to provide more data. label Feb 9, 2022
@uenokatsura
Copy link
Author

well, i use ipv6 to bypass some network blocking/interference in china thats why i do this.
so can i force enable ipv6 for DoH/DoT server

@ainar-g ainar-g changed the title Adg home not communicate with DoH/DoT server via IPv6 if A records exist Allow choosing IP version preference for upstream servers Feb 9, 2022
@ainar-g ainar-g added feature request and removed waiting for data Waiting for users to provide more data. labels Feb 9, 2022
@ainar-g
Copy link
Contributor

ainar-g commented Feb 9, 2022

I see, thanks! We'll consider ways we could do that.

@gspannu
Copy link

gspannu commented Feb 9, 2022

Expected Behavior

Adguard Home communicate with Google DNS(DoT/DoH) in IPv6

Actual Behavior

It just ignore the AAAA record and request with IPv4

Are you saying that even if you put

https://dns64.dns.google/dns-query
tls://dns64.dns.google

as your upstream DNS servers, AGH still sends the request to the Google IPv4 addresses?

I too am keen to understand the behaviour of AGH

@ainar-g
Copy link
Contributor

ainar-g commented Feb 10, 2022

@gspannu, from what I can see, those have only IPv6 addresses, so those are used. AdGuard Home merely prioritizes IPv4 addresses. It doesn't completely ignore IPv6 addresses.

@CelicaS
Copy link

CelicaS commented Jun 24, 2022

I see, thanks! We'll consider ways we could do that.

Thanks to the developer,really need this feature
14
ipv6+ipv4
301
only ipv6
06

@daryll-swer
Copy link

Any updates on this in 2023? DNS traffic originating from AdGuard Home uses 99.99% IPv4, even though the underlying host has native IPv6.

Here's data from the Cloudflare peering portal for my ASN, whereby we can see 99% of DNS traffic to them, from my network (AdGuard Home) is IPv4. IPv6 is ignored completely.

image

@ainar-g ainar-g self-assigned this Apr 3, 2023
@ainar-g ainar-g added this to the v0.107.27 milestone Apr 3, 2023
adguard pushed a commit to AdguardTeam/dnsproxy that referenced this issue Apr 3, 2023
Updates AdguardTeam/AdGuardHome#4262.

Squashed commit of the following:

commit 0f2c311
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon Apr 3 17:39:16 2023 +0300

    all: add ip proto pref
adguard pushed a commit that referenced this issue Apr 4, 2023
Updates #4262.

Squashed commit of the following:

commit de64f9c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon Apr 3 19:23:15 2023 +0300

    all: add ipv6 boostrap pref
@ainar-g
Copy link
Contributor

ainar-g commented Apr 4, 2023

@chemcodex, we've added this feature in the latest Edge release. You can enable IPv6 preference for bootstrapping DoH, DoT, and DoQ upstreams by stopping AGH, setting dns.bootstrap_prefer_ipv6 to true, and restarting AGH again. Can you please check if the feature works for you?

@uenokatsura
Copy link
Author

@ainar-g thank you, its working perfectly. wait for it to be pushed to stable channel
image

@daryll-swer
Copy link

Does this fix only for bootstrapping or also fixes for main DNS queries sent via upstream? @chemcodex/@ainar-g?

@uenokatsura
Copy link
Author

Does this fix only for bootstrapping or also fixes for main DNS queries sent via upstream? @chemcodex/@ainar-g?

i think it fixes the upstream queries, though the string name is dns.bootstrap_prefer_ipv6.
image

@ainar-g
Copy link
Contributor

ainar-g commented Apr 4, 2023

@daryll-swer, I'm not sure what you mean, sorry. The change makes it possible to prefer IPv6 addresses of hostnames that you use for DoH, DoT, and DoQ. That is, if you use https://dns.adguard-dns.com/dns-query as the DoH upstream then by default AGH will prefer IPv4 addresses of dns.adguard-dns.com (e.g. 94.140.14.14), but with this flag set to true it will prefer the IPv6 ones (e.g. 2a10:50c0::ad1:ff).

@daryll-swer
Copy link

@daryll-swer, I'm not sure what you mean, sorry. The change makes it possible to prefer IPv6 addresses of hostnames that you use for DoH, DoT, and DoQ. That is, if you use https://dns.adguard-dns.com/dns-query as the DoH upstream then by default AGH will prefer IPv4 addresses of dns.adguard-dns.com (e.g. 94.140.14.14), but with this flag set to true it will prefer the IPv6 ones (e.g. 2a10:50c0::ad1:ff).

Yes, that's what I meant. I'm unable to test the edge build as I do not have the time, but will surely check it out in stable release. I can easily fetch real-time data from Cloudflare portal for network to verify.

@grzchr15
Copy link

grzchr15 commented Apr 7, 2023

https://internet.nl/site/dns.adguard-dns.com/2025187/#

please can we get tls configuration also fixed?

@ainar-g
Copy link
Contributor

ainar-g commented Apr 7, 2023

@grzchr15, that looks like an issue related to AdGuard DNS< not AdGuard Home, so it's off-topic in this repository. Also please see #5670.

@ainar-g ainar-g modified the milestones: v0.107.29, v0.107.28 Apr 12, 2023
@daryll-swer
Copy link

@ainar-g So it's been 30 days of testing. As per the data I pulled from Cloudflare peering portal, we can see that indeed AdGuard Home is sending queries over IPv6, however it is still preferring IPv4 most of the time based on the data, even though the underlying IPv6 network and routing is symmetrical and identical to IPv4.

AdGuard Home still needs further improvements in this regard. IPv6 when set to preferred should be preferred 100% with v4 as fallback in case v6 is unreachable.

image

@kiwilad-nz
Copy link

Will this be pushed to stable any time soon?

Cheers.

@uenokatsura
Copy link
Author

uenokatsura commented Aug 20, 2023 via email

@kiwilad-nz
Copy link

kiwilad-nz commented Aug 20, 2023 via email

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