diff options
Diffstat (limited to 'vendor/github.com/caddyserver/certmagic/dnsutil.go')
-rw-r--r-- | vendor/github.com/caddyserver/certmagic/dnsutil.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/vendor/github.com/caddyserver/certmagic/dnsutil.go b/vendor/github.com/caddyserver/certmagic/dnsutil.go index 85f7714a80..2573cb9663 100644 --- a/vendor/github.com/caddyserver/certmagic/dnsutil.go +++ b/vendor/github.com/caddyserver/certmagic/dnsutil.go @@ -313,11 +313,17 @@ func updateDomainWithCName(r *dns.Msg, fqdn string) string { } // recursiveNameservers are used to pre-check DNS propagation. It -// prepends user-configured nameservers (custom) to the defaults -// obtained from resolv.conf and defaultNameservers and ensures -// that all server addresses have a port value. +// picks user-configured nameservers (custom) OR the defaults +// obtained from resolv.conf and defaultNameservers if none is +// configured and ensures that all server addresses have a port value. func recursiveNameservers(custom []string) []string { - servers := append(custom, systemOrDefaultNameservers(defaultResolvConf, defaultNameservers)...) + var servers []string + if len(custom) == 0 { + servers = systemOrDefaultNameservers(defaultResolvConf, defaultNameservers) + } else { + servers = make([]string, len(custom)) + copy(servers, custom) + } populateNameserverPorts(servers) return servers } |