Documentation ¶
Overview ¶
Package file implements a file backend.
Index ¶
- Constants
- type Apex
- type File
- type Result
- type Xfr
- type Zone
- func (z *Zone) ApexIfDefined() ([]dns.RR, error)
- func (z *Zone) ClosestEncloser(qname string) (*tree.Elem, bool)
- func (z *Zone) Copy() *Zone
- func (z *Zone) CopyWithoutApex() *Zone
- func (z *Zone) File() string
- func (z *Zone) Insert(r dns.RR) error
- func (z *Zone) Lookup(ctx context.Context, state request.Request, qname string) ([]dns.RR, []dns.RR, []dns.RR, Result)
- func (z *Zone) Notify()
- func (z *Zone) OnShutdown() error
- func (z *Zone) Reload() error
- func (z *Zone) SOASerialIfDefined() int64
- func (z *Zone) SetFile(path string)
- func (z *Zone) TransferAllowed(state request.Request) bool
- func (z *Zone) TransferIn() error
- func (z *Zone) Update() error
- type Zones
Constants ¶
const MaxSerialIncrement uint32 = 2147483647
MaxSerialIncrement is the maximum difference between two serial numbers. If the difference between two serials is greater than this number, the smaller one is considered greater.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result int
Result is the result of a Lookup
const ( // Success is a successful lookup. Success Result = iota // NameError indicates a nameerror NameError // Delegation indicates the lookup resulted in a delegation. Delegation // NoData indicates the lookup resulted in a NODATA. NoData // ServerFailure indicates a server failure during the lookup. ServerFailure )
type Xfr ¶
type Xfr struct {
*Zone
}
Xfr serves up an AXFR.
func (Xfr) ServeIxfr ¶ added in v1.6.3
ServeIxfr checks if we need to serve a simpler IXFR for the incoming message. See RFC 1995 Section 3: "... and the authority section containing the SOA record of client's version of the zone." and Section 2, paragraph 4 where we only need to echo the SOA record back. This function must be called when the qtype is IXFR. It returns a plugin.ClientWrite(code) == false, when it didn't write anything and we should perform an AXFR.
type Zone ¶
type Zone struct { *tree.Tree Apex Expired bool sync.RWMutex TransferTo []string StartupOnce sync.Once TransferFrom []string ReloadInterval time.Duration Upstream *upstream.Upstream // Upstream for looking up external names during the resolution process. // contains filtered or unexported fields }
Zone is a structure that contains all data related to a DNS zone.
func Parse ¶
Parse parses the zone in filename and returns a new Zone or an error. If serial >= 0 it will reload the zone, if the SOA hasn't changed it returns an error indicating nothing was read.
func (*Zone) ApexIfDefined ¶ added in v1.6.3
ApexIfDefined returns the apex nodes from z. The SOA record is the first record, if it does not exist, an error is returned.
func (*Zone) ClosestEncloser ¶
ClosestEncloser returns the closest encloser for qname.
func (*Zone) CopyWithoutApex ¶ added in v1.0.5
CopyWithoutApex copies zone z without the Apex records.
func (*Zone) Lookup ¶
func (z *Zone) Lookup(ctx context.Context, state request.Request, qname string) ([]dns.RR, []dns.RR, []dns.RR, Result)
Lookup looks up qname and qtype in the zone. When do is true DNSSEC records are included. Three sets of records are returned, one for the answer, one for authority and one for the additional section.
func (*Zone) Notify ¶
func (z *Zone) Notify()
Notify will send notifies to all configured TransferTo IP addresses.
func (*Zone) OnShutdown ¶ added in v1.1.0
OnShutdown shuts down any running go-routines for this zone.
func (*Zone) Reload ¶
Reload reloads a zone when it is changed on disk. If z.NoReload is true, no reloading will be done.
func (*Zone) SOASerialIfDefined ¶
SOASerialIfDefined returns the SOA's serial if the zone has a SOA record in the Apex, or -1 otherwise.
func (*Zone) TransferAllowed ¶
TransferAllowed checks if incoming request for transferring the zone is allowed according to the ACLs.
func (*Zone) TransferIn ¶
TransferIn retrieves the zone from the masters, parses it and sets it live.
func (*Zone) Update ¶
Update updates the secondary zone according to its SOA. It will run for the life time of the server and uses the SOA parameters. Every refresh it will check for a new SOA number. If that fails (for all server) it will retry every retry interval. If the zone failed to transfer before the expire, the zone will be marked expired.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package rrutil provides function to find certain RRs in slices.
|
Package rrutil provides function to find certain RRs in slices. |
Package tree implements Left-Leaning Red Black trees as described by Robert Sedgewick.
|
Package tree implements Left-Leaning Red Black trees as described by Robert Sedgewick. |