mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-10-12 01:58:46 +02:00
Always use ctrld bootstrap nameserver for ResolverTypeOS
So in case no nameservers can be found, default OS resolver could still resolve queries.
This commit is contained in:
1 parent
6028b8f186
commit
073af0f89c
1 file changed
+8
-6
+8
-6
@@ -27,13 +27,15 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var bootstrapDNS = "76.76.2.0"
|
var bootstrapDNS = "76.76.2.0"
|
||||||
var or = &osResolver{nameservers: nameservers()}
|
|
||||||
|
|
||||||
func init() {
|
// or is the Resolver used for ResolverTypeOS.
|
||||||
if len(or.nameservers) == 0 {
|
var or = &osResolver{nameservers: defaultNameservers()}
|
||||||
// Add bootstrap DNS in case we did not find any.
|
|
||||||
or.nameservers = []string{net.JoinHostPort(bootstrapDNS, "53")}
|
// defaultNameservers returns OS nameservers plus ctrld bootstrap nameserver.
|
||||||
}
|
func defaultNameservers() []string {
|
||||||
|
ns := nameservers()
|
||||||
|
ns = append(ns, net.JoinHostPort(bootstrapDNS, "53"))
|
||||||
|
return ns
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resolver is the interface that wraps the basic DNS operations.
|
// Resolver is the interface that wraps the basic DNS operations.
|
||||||
|
|||||||
Reference in new issue
Block a user