Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("no records found")
ErrNotFound is returned when no DNS records are found.
Functions ¶
func GetDNSServers ¶
GetDNSServers returns the list of DNS servers from the local system configuration (e.g., /etc/resolv.conf).
func ValidateDNSServer ¶
ValidateDNSServer validates a list of DNS servers by sending a query to each of them and checking if they respond with a valid answer. It returns a list of valid servers and an error if no valid server is found.
Types ¶
type Options ¶
type Options struct {
// dns server for querying
Servers []string
Hostsfile string
Order []string
Timeout time.Duration
SkipTest bool
}
Options contains configuration for the Resolver.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver is a DNS resolver that supports hosts file and caching.
func NewResolver ¶
NewResolver creates a new Resolver instance with the given options.
Click to show internal directories.
Click to hide internal directories.