Documentation ¶
Index ¶
- Constants
- type Apex
- type File
- type Result
- type Xfr
- type Zone
- func (z *Zone) All() []dns.RR
- func (z *Zone) ClosestEncloser(qname string, qtype uint16) string
- func (z *Zone) Copy() *Zone
- func (z *Zone) Delete(r dns.RR)
- func (z *Zone) Insert(r dns.RR) error
- func (z *Zone) Lookup(qname string, qtype uint16, do bool) ([]dns.RR, []dns.RR, []dns.RR, Result)
- func (z *Zone) Notify()
- func (z *Zone) Reload(shutdown chan bool) error
- func (z *Zone) TransferAllowed(state middleware.State) bool
- func (z *Zone) TransferIn() error
- func (z *Zone) Update() error
- type Zones
Examples ¶
Constants ¶
const MaxSerialIncrement uint32 = 2147483647
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 File ¶
type File struct { Next middleware.Handler Zones Zones }
type Zone ¶
type Zone struct { *tree.Tree Apex Apex TransferTo []string StartupOnce sync.Once TransferFrom []string Expired *bool NoReload bool // contains filtered or unexported fields }
func (*Zone) All ¶
All returns all records from the zone, the first record will be the SOA record, otionally followed by all RRSIG(SOA)s.
Example ¶
zone, err := Parse(strings.NewReader(dbMiekNL), testzone, "stdin") if err != nil { return } records := zone.All() for _, r := range records { fmt.Printf("%+v\n", r) } // Output // xfr_test.go:15: miek.nl. 1800 IN SOA linode.atoom.net. miek.miek.nl. 1282630057 14400 3600 604800 14400 // xfr_test.go:15: www.miek.nl. 1800 IN CNAME a.miek.nl. // xfr_test.go:15: miek.nl. 1800 IN NS linode.atoom.net. // xfr_test.go:15: miek.nl. 1800 IN NS ns-ext.nlnetlabs.nl. // xfr_test.go:15: miek.nl. 1800 IN NS omval.tednet.nl. // xfr_test.go:15: miek.nl. 1800 IN NS ext.ns.whyscream.net. // xfr_test.go:15: miek.nl. 1800 IN MX 1 aspmx.l.google.com. // xfr_test.go:15: miek.nl. 1800 IN MX 5 alt1.aspmx.l.google.com. // xfr_test.go:15: miek.nl. 1800 IN MX 5 alt2.aspmx.l.google.com. // xfr_test.go:15: miek.nl. 1800 IN MX 10 aspmx2.googlemail.com. // xfr_test.go:15: miek.nl. 1800 IN MX 10 aspmx3.googlemail.com. // xfr_test.go:15: miek.nl. 1800 IN A 139.162.196.78 // xfr_test.go:15: miek.nl. 1800 IN AAAA 2a01:7e00::f03c:91ff:fef1:6735 // xfr_test.go:15: archive.miek.nl. 1800 IN CNAME a.miek.nl. // xfr_test.go:15: a.miek.nl. 1800 IN A 139.162.196.78 // xfr_test.go:15: a.miek.nl. 1800 IN AAAA 2a01:7e00::f03c:91ff:fef1:6735
Output:
func (*Zone) ClosestEncloser ¶
ClosestEncloser returns the closest encloser for rr.
func (*Zone) Lookup ¶
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) TransferAllowed ¶
func (z *Zone) TransferAllowed(state middleware.State) bool
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 wil retry every retry interval. If the zone failed to transfer before the expire, the zone will be marked expired.