AdguardTeam / AdGuardHome

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

please more style for the assign dns #4855

Closed laughtLOOL closed 2 years ago

laughtLOOL commented 2 years ago

Prerequisites

Description

for example, use this code can let the *.apple.com to the dns.google. [/apple.com/]tls://dns.google

like that gspe1-ssl.ls.apple.com guzzoni.apple.com would be in a list.

but the link was not also to be easy, like that link apac-china-courier-4.push-apple.com.akadns.net guzzoni-apple-com.v.aaplimg.com caldav.fe.apple-dns.cn

i dont want to set that formal for each, because i just set a example, in fact have a lot of like that [/push-apple.com.akadns.net/]tls://dns.google [/apple-com.v.aaplimg.com/]tls://dns.google

that is waste too much space if set that each for the dns list. i hope the dns list can read the keyword is apple, this link have apple would be go to dns.google it not only apple have that problem, google, microsoft is same have not formal link. hope add the rule like the ban list like /google/, ||google^$important can ban the keyword for the link like that fcm.googleapis.com www.google.com googleads.g.doubleclick.net

fernvenue commented 2 years ago

Keyword sounds not that bad, but not a great solution I think. What you really need is a list and use the upstream_dns_file configuration. Keyword matching typically presents two major problems:

For example, if you're just using keyword youtube for YouTube, the static files like images on YouTube will not be resolving by your specific upstream, because it's using i.ytimg.com, and the videos on YouTube are not using youtube.com or its subdomain actually, it's using *.googlevideo.com.

And yeah, there are so many domains include the keyword youtube, they might support by YouTube officially, or they might not, and maybe there are completely nothing to do with YouTube. This is just an example, given that YouTube is a well-known brand, that may be looking better, other sites that are not so well-known are not so lucky, and the probability of matching their keywords will be greatly improved for sites that have nothing to do with it, and the actual experience may be very Oops.

By the way, if you are just finding some way to accelerate internet in China, you can just use upstream_dns_file as documentation said, and if you're a little confused about the dnsmasq to AdGuardHome, you might wanna try fernvenue/adguardhome-upstream.

Just a personal opinion, have a great day :)

laughtLOOL commented 2 years ago

that is a mind for before i link the microsoft all server like login page, office, onedrive some thing, the loading page so long time, and i try to set the microsoft.com, office.com etc to the 4.2.2.2, and i found the loading time was quicker, 5 sec to 1 sec, a big improve, and my apple device have same problem like the appstore etc loading so long time problem, so i try to improve but such as not a good dns for apple, in my place, i try to use the dns.alidns.com/dns-query is second fast dns but sound not good, so want to try more dns which is faster. i have been done the google to the dns like that [/googleapis.com/]https://dns.google/dns-query [/googlevideo.com/]tls://dns.google [/youtube.com/]tls://dns.google [/ytimg.com/]tls://dns.google [/google.com/]tls://dns.google why not let it free to go because the google would go dns.alidns.com/dns-query very usually, that i dont want that, in fact that was not faster because it will go to third party dns, like here show go to alidns and it will go though cisco and final arrive google. so i set like that was pass the cisco third party and direct to google.

laughtLOOL commented 2 years ago

if have the keyword feature i can save the line of the dns list, that can look the list not complex, and i not sure the list too much would be increase the process speed, so want to make simplify

fernvenue commented 2 years ago

Don't worry about that, speed is not an issue as long as you have enough RAM, or you can just check the code: https://github.com/AdguardTeam/dnsproxy/blob/2193a7198ae85d7a3ba633140d74eded38096e70/proxy/upstreams.go#L18 here. AdGuardHome can easily handle lists with millions of content (though I don't think such a large list is necessary) with enough RAM in my tests.

In your case, I still believe that you will inevitably encounter the two problems mentioned above with the keyword matching feature. And again, I think you really should try upstream_dns_file with the list just as documentation said:

Using specific upstreams for some domains is a common way to accelerate internet in China. For an example, see https://github.com/felixonmars/dnsmasq-china-list or any other of the many dnsmasq lists.

That list collects domains that use NS servers located in mainland China, allowing us to use some DNS servers for them that don't break CDN or geo-based results, while using encrypted and trusted DNS servers for other domains, in this way you will get the best local results and unpoisoned external results.

All in all, I'm not against the keyword matching feature, it turns out to work well with Block Lists, but I still don't think it's a good idea to add it to Upstream Lists, it's a completely different use case.

ainar-g commented 2 years ago

@laughtLOOL, if I understood you correctly, you would like something like regular expressions for upstream addresses? If so, this is a duplicate of #2432.

laughtLOOL commented 2 years ago

yes, that is actually i want to say https://github.com/AdguardTeam/AdGuardHome/issues/2432 image , i just hope can [/www.google./] or [/www.google/] like that to list the more range of this webiste, like www.google.com.au or mail.icloud.com.cn. that i type the list like that [/mail.icloud.com*/] can read the com.cn by automatic , if use the https://github.com/felixonmars/dnsmasq-china-list eg, have many list may not use, that waste the memory and not effect, just accelerate the request allow list at the previous link can give a big improve.

ainar-g commented 2 years ago

I see, thanks. I'll merge this issue into that one then.