diff options
author | 2016-03-27 07:37:23 +0100 | |
---|---|---|
committer | 2016-03-28 10:15:05 +0100 | |
commit | 5387c162c994d7d81ccf21c8c8f9d9959ed27240 (patch) | |
tree | f10c1777f3cd96a42c67b8c955c737c88aa58744 /middleware/file/zone.go | |
parent | 9eeb2b02595664e861ae639933555b3ed507c93d (diff) | |
download | coredns-5387c162c994d7d81ccf21c8c8f9d9959ed27240.tar.gz coredns-5387c162c994d7d81ccf21c8c8f9d9959ed27240.tar.zst coredns-5387c162c994d7d81ccf21c8c8f9d9959ed27240.zip |
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.
Diffstat (limited to 'middleware/file/zone.go')
-rw-r--r-- | middleware/file/zone.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/middleware/file/zone.go b/middleware/file/zone.go new file mode 100644 index 000000000..57eb8d997 --- /dev/null +++ b/middleware/file/zone.go @@ -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) +} |