middleware/file: additional section processing (#531)

Add additional section processing for MX and SRV records. Update the
tests.
This commit is contained in:
Miek Gieben
2017-02-19 20:42:34 +00:00
committed by GitHub
parent ea38b642b8
commit 3e26398e08
2 changed files with 68 additions and 3 deletions

View File

@@ -74,6 +74,28 @@ var dnsTestCases = []test.Case{
test.SOA("miek.nl. 1800 IN SOA linode.atoom.net. miek.miek.nl. 1282630057 14400 3600 604800 14400"),
},
},
{
Qname: "srv.miek.nl.", Qtype: dns.TypeSRV,
Answer: []dns.RR{
test.SRV("srv.miek.nl. 1800 IN SRV 10 10 8080 a.miek.nl."),
},
Extra: []dns.RR{
test.A("a.miek.nl. 1800 IN A 139.162.196.78"),
test.AAAA("a.miek.nl. 1800 IN AAAA 2a01:7e00::f03c:91ff:fef1:6735"),
},
Ns: miekAuth,
},
{
Qname: "mx.miek.nl.", Qtype: dns.TypeMX,
Answer: []dns.RR{
test.MX("mx.miek.nl. 1800 IN MX 10 a.miek.nl."),
},
Extra: []dns.RR{
test.A("a.miek.nl. 1800 IN A 139.162.196.78"),
test.AAAA("a.miek.nl. 1800 IN AAAA 2a01:7e00::f03c:91ff:fef1:6735"),
},
Ns: miekAuth,
},
}
const (
@@ -185,4 +207,7 @@ $ORIGIN miek.nl.
a IN A 139.162.196.78
IN AAAA 2a01:7e00::f03c:91ff:fef1:6735
www IN CNAME a
archive IN CNAME a`
archive IN CNAME a
srv IN SRV 10 10 8080 a.miek.nl.
mx IN MX 10 a.miek.nl.`