diff --git a/dnscrypt-proxy/xtransport.go b/dnscrypt-proxy/xtransport.go index bc50d5fd..b4457257 100644 --- a/dnscrypt-proxy/xtransport.go +++ b/dnscrypt-proxy/xtransport.go @@ -9,6 +9,7 @@ import ( "encoding/base64" "encoding/hex" "errors" + "fmt" "io" "math/rand" "net" @@ -415,6 +416,9 @@ func (xTransport *XTransport) resolveAndUpdateCache(host string) error { return err } } + if foundIP == nil { + return fmt.Errorf("no IP address found for [%s]", host) + } xTransport.saveCachedIP(host, foundIP, ttl) dlog.Debugf("[%s] IP address [%s] added to the cache, valid for %v", host, foundIP, ttl) return nil