fix: set ndots default value as 0

closes https://github.com/mr-karan/doggo/issues/13
pull/14/head
Karan Sharma 2021-02-17 15:35:32 +05:30
parent a8769e1df5
commit 0075911319
2 changed files with 1 additions and 9 deletions

View File

@ -57,7 +57,7 @@ func (hub *Hub) loadNameservers() error {
// if the user hasn't given any override of `ndots` AND has
// given a custom nameserver. Set `ndots` to 1 as the fallback value
if hub.ResolverOpts.Ndots == -1 {
hub.ResolverOpts.Ndots = 1
hub.ResolverOpts.Ndots = 0
}
return nil
}

View File

@ -10,14 +10,6 @@ import (
// to configure a resolver from the query args.
func (hub *Hub) loadResolverOptions() {
hub.ResolverOpts.Timeout = hub.QueryFlags.Timeout
// in case `ndots` is not set by `/etc/resolv.conf` while parsing
// the config for a system default namseserver.
if hub.ResolverOpts.Ndots == 0 {
// in case the user has not specified any `ndots` arg.
if hub.QueryFlags.Ndots == 0 {
hub.ResolverOpts.Ndots = 1
}
}
}
// loadResolvers loads differently configured