Exemplo n.º 1
0
Arquivo: dns.go Projeto: postfix/goss
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,
	}
}
Exemplo n.º 2
0
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
}
Exemplo n.º 3
0
Arquivo: dns.go Projeto: netluxe/goss
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
}