Documentation ¶
Overview ¶
Package dnsxl provides a xlistd.List implementation that uses a dns zone as a source for its checks.
This package is a work in progress and makes no API stability promises.
Index ¶
Constants ¶
const ComponentClass = "dnsxl"
ComponentClass registered.
Variables ¶
This section is empty.
Functions ¶
func Builder ¶
func Builder(defaultCfg Config) xlistd.BuildListFn
Builder returns a builder function.
func DefaultResolver ¶
func DefaultResolver(resolver Resolver)
DefaultResolver sets the default resolver for all new instances
Types ¶
type Config ¶
type Config struct { Timeout time.Duration ForceValidation bool DoReverse bool HalfPing bool ResolveReason bool AuthToken string Reason string PingDNS string Resolver Resolver Retries int DNSCodes map[string]string ErrCodes map[string]string }
Config options.
type List ¶
type List struct {
// contains filtered or unexported fields
}
List implements an xlistd.List that checks against DNS blacklists.
func New ¶
func New(id, zone string, resources []xlist.Resource, cfg Config, logger yalogi.Logger) (*List, error)
New creates a new DNSxL based RBL.
type ResolverRRPool ¶
type ResolverRRPool struct {
// contains filtered or unexported fields
}
ResolverRRPool implements Resolver interface with a round robbin pool
func NewResolverFromConf ¶
func NewResolverFromConf(file string) (*ResolverRRPool, error)
NewResolverFromConf returns a dns pool from a resolv.conf file
func NewResolverPoolFromZone ¶
func NewResolverPoolFromZone(zone string) (*ResolverRRPool, error)
NewResolverPoolFromZone queries a dns zone for its name servers and returns a resolver pool
func NewResolverRRPool ¶
func NewResolverRRPool(addresses []string) (*ResolverRRPool, error)
NewResolverRRPool constructs a dns server pool with passed addresses.
func (*ResolverRRPool) Ping ¶
func (p *ResolverRRPool) Ping(domain string) error
Ping implements interface Resolver checking that all resolvers in the pool resolves the domain name passed as parameter. Returns an error if something is not working.
func (*ResolverRRPool) Resolver ¶
func (p *ResolverRRPool) Resolver() string
Resolver implements interface returning the next server in the pool