dnscache

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

func NewCachedResolver

func NewCachedResolver() (*Resolver, error)

NewCachedResolver runs a DNS Cache to avoid frequent DNS queries to the host OS. This save CPU and time. This DNS Cache is fairly simple (v0.7)

func (*Resolver) LookupHost

func (r *Resolver) LookupHost(ctx context.Context, host string, ipv int) (addrs []string, err error)

LookupHost looks up the given host As a cache DNS, if the host is present and still valid (TTL) no queries will be made to a DNS resolver. If the host is absent in the cache, a query will be made then the result saved for later queries.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL