func NewDNS(sysDNS system.DNS) *DNS { host := sysDNS.Host() addrs, _ := sysDNS.Addrs() resolveable, _ := sysDNS.Resolveable() return &DNS{ Host: host, Addrs: addrs, Resolveable: resolveable.(bool), Timeout: 500, } }
func NewDNS(sysDNS system.DNS, config util.Config) (*DNS, error) { host := sysDNS.Host() resolveable, err := sysDNS.Resolveable() d := &DNS{ Host: host, Resolveable: resolveable, Timeout: config.Timeout, } if !contains(config.IgnoreList, "addrs") { addrs, _ := sysDNS.Addrs() d.Addrs = addrs } return d, err }
func NewDNS(sysDNS system.DNS, ignoreList []string) *DNS { host := sysDNS.Host() resolveable, _ := sysDNS.Resolveable() d := &DNS{ Host: host, Resolveable: resolveable.(bool), Timeout: 500, } if !contains(ignoreList, "addrs") { addrs, _ := sysDNS.Addrs() d.Addrs = addrs } return d }