mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 02:33:14 -04:00
Implement a DNS zone
Full implementation, DNS (and in the future DNSSEC). Returns answer in a hopefully standards compliant way. Testing with my miek.nl zone are included as well. This should correctly handle nodata, nxdomain and cnames.
This commit is contained in:
26
middleware/file/zone.go
Normal file
26
middleware/file/zone.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package file
|
||||
|
||||
import (
|
||||
"github.com/miekg/coredns/middleware/file/tree"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
)
|
||||
|
||||
type Zone struct {
|
||||
SOA *dns.SOA
|
||||
SIG []*dns.RRSIG
|
||||
name string
|
||||
*tree.Tree
|
||||
}
|
||||
|
||||
func NewZone(name string) *Zone {
|
||||
return &Zone{name: dns.Fqdn(name), Tree: &tree.Tree{}}
|
||||
}
|
||||
|
||||
func (z *Zone) Insert(r dns.RR) {
|
||||
z.Tree.Insert(r)
|
||||
}
|
||||
|
||||
func (z *Zone) Delete(r dns.RR) {
|
||||
z.Tree.Delete(r)
|
||||
}
|
||||
Reference in New Issue
Block a user