AdguardTeam / AdGuardHome

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

dns ipv4/ipv6 resolution result prioritization function #6812

Open PlutoNameless opened 5 months ago

PlutoNameless commented 5 months ago

Prerequisites

The problem

My internet carrier provides ipv4 & ipv6 addresses, and I have ipv6 resolution enabled on adguardhome, and my fill-in dns provider supports ipv4 & ipv6 resolution; But the current adguardhome policy, if a domain has an ipv6 address, it will prioritize ipv6 and ignore ipv4; In my area, the ipv6 network construction is not too healthy, if the data goes to ipv6 network, its access latency will be much higher than ipv4, but I don't want to turn off ipv6 resolution on my adguardhome.

Proposed solution

Is it possible to provide such a switch when ipv6 resolution is turned on on adguardhome; "Prioritize the ipv4 address in the domain resolution address (if it has both ipv4 and ipv6 addresses)" When this switch is turned on, it will first query if the address has an ipv4 address, if it does it will be responsible for directly accessing the ipv4 address of the domain name, if it doesn't then continue to query if it has an ipv6 address;

Alternatives considered and additional information

No response

PlutoNameless commented 5 months ago

I found a related discussion in https://github.com/AdguardTeam/AdGuardHome/issues/5919 , but there is no follow-up to this discussion; I make more additional descriptions of application scenarios for this problem: In my region ipv6 is in a state of construction, it is not as robust as ipv4, but since the regional ipv4 resources are depleted, my ipv4 is in the state of NAT4 and ipv6 is in nat1; Some partners will make the services they build available to others via ddns; If I leave the ipv6 resolution disable switch on in my current adguardhome, I will not be able to access these services; If I leave him off, many current apps will prioritize the use of ipv6, resulting in much slower resource access and loading than using only ipv4; So I expect to have a feature that prioritizes ipv4 when processing client requests on adguardhome, I can see how request a or aaaa should be handled by the client as a rule, but in the current situation I want to get the dividends of ipv6 and have the stability of ipv4 at the same time this is a compromise.

qingxiaoxinrou commented 5 months ago

在官方未提供方法的情况下 我记得前段时间有个issues要求指定DOH的ip地址 你可以翻一下历史记录并通过这种方法实现 或者修改所搭建adguardhome的Bootstrap DNS 服务器为另一个不支持AAAA记录返回的ADGH服务器地址来达到只访问V4的目的