- if upstream DNS is missing fallbacks on localresponder if defined, else on "127.0.0.53:53" as last chance

This commit is contained in:
bloved 2021-01-15 00:55:08 +01:00
parent 31e05cb177
commit 946a2245cc
1 changed files with 5 additions and 0 deletions

View File

@ -88,6 +88,11 @@ func oneTimeDNS(config string) (dns string) {
upl := ZabovConfigs[config].ZabovDNSArray upl := ZabovConfigs[config].ZabovDNSArray
if len(upl) < 1 { if len(upl) < 1 {
if len(ZabovLocalResponder) > 0 {
fmt.Println("No DNS defined, fallback to local responder:", ZabovLocalResponder)
return ZabovLocalResponder
}
fmt.Println("No DNS defined, using default 127.0.0.53:53. Hope it works!") fmt.Println("No DNS defined, using default 127.0.0.53:53. Hope it works!")
return "127.0.0.53:53" return "127.0.0.53:53"
} }