diff options
author | 2016-03-28 12:08:05 +0100 | |
---|---|---|
committer | 2016-03-28 18:23:17 +0100 | |
commit | e56d206542c901a48b28c4501fe5805e9e9e1a10 (patch) | |
tree | 77a644f6fe28f3de8eaf6f7c766cea73b438b487 /middleware/file/xfr_test.go | |
parent | 6324bb1fa7c0516ef3bebfb822a0cdc767764ad2 (diff) | |
download | coredns-e56d206542c901a48b28c4501fe5805e9e9e1a10.tar.gz coredns-e56d206542c901a48b28c4501fe5805e9e9e1a10.tar.zst coredns-e56d206542c901a48b28c4501fe5805e9e9e1a10.zip |
Support outgoing zone transfers
These can be enabled by adding "transfer out" to the Corefile. Without
it no AXFR is allowed.
For now only AXFR and no IXFR. No TSIG and no ACLs.
Diffstat (limited to 'middleware/file/xfr_test.go')
-rw-r--r-- | middleware/file/xfr_test.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/middleware/file/xfr_test.go b/middleware/file/xfr_test.go new file mode 100644 index 000000000..07caaf1d9 --- /dev/null +++ b/middleware/file/xfr_test.go @@ -0,0 +1,34 @@ +package file + +import ( + "fmt" + "strings" +) + +func ExampleZone_All() { + 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 +} |