fix(updater): only uses DoH to cloudflare+google

- prevent dns plaintext manipulation both the periodic update and when running in cli mode
- possibly higher reliability on poor connections versus UDP
- drop `-dns` flag in update command
- for now no configuration allowed since it makes everything rather complex
This commit is contained in:
Quentin McGaw
2026-03-06 21:01:52 +00:00
parent 457e5597bb
commit b7735ecc00
7 changed files with 47 additions and 37 deletions
+2 -7
View File
@@ -1,17 +1,12 @@
package resolver
import (
"context"
"net"
)
func newResolver(resolverAddress string) *net.Resolver {
d := net.Dialer{}
resolverAddress = net.JoinHostPort(resolverAddress, "53")
func newResolver(d Dialer) *net.Resolver {
return &net.Resolver{
PreferGo: true,
Dial: func(ctx context.Context, _, _ string) (net.Conn, error) {
return d.DialContext(ctx, "udp", resolverAddress)
},
Dial: d.Dial,
}
}