update to latest github.com/mjl-/adns, synced to go1.24.1

This commit is contained in:
Mechiel Lukkien
2025-03-21 18:42:02 +01:00
parent 70aedddc90
commit 773d8cc959
14 changed files with 188 additions and 159 deletions

View File

@ -10,10 +10,22 @@ import (
"time"
)
var (
defaultNS = []string{"127.0.0.1:53", "[::1]:53"}
getHostname = os.Hostname // variable for testing
)
// defaultNS is the default name servers to use in the absence of DNS configuration.
//
// defaultNS should be an internal detail,
// but widely used packages access it using linkname.
// Notable members of the hall of shame include:
// - github.com/pojntfx/hydrapp/hydrapp
// - github.com/mtibben/androiddnsfix
// - github.com/metacubex/mihomo
//
// Do not remove or change the type signature.
// See go.dev/issue/67401.
//
// disabled: go:linkname defaultNS
var defaultNS = []string{"127.0.0.1:53", "[::1]:53"}
var getHostname = os.Hostname // variable for testing
type dnsConfig struct {
servers []string // server addresses (in host:port form) to use