Propagate DNS setting to configuration

This commit is contained in:
9seconds
2026-02-27 16:23:24 +01:00
parent 317d7380cb
commit 897e6bf505
6 changed files with 234 additions and 14 deletions
+8
View File
@@ -21,6 +21,14 @@ func GetDNS(u *url.URL) (*net.Resolver, error) {
return dns.NewCachingResolver(nil, dnsCacheOptions...), nil
}
if u.Scheme == "" {
u.Scheme = "udp"
}
if u.Scheme == "udp" && u.Host == "" {
u.Host = u.Path
u.Path = ""
}
switch u.Scheme {
case "tls":
return dns.NewDoTResolver(u.Host, dns.DoTCache(dnsCacheOptions...))