diff options
author | 2018-11-16 14:42:49 +0100 | |
---|---|---|
committer | 2018-11-16 08:42:49 -0500 | |
commit | 8dbe1fbee227d6830d61a169eb947f4c243c76d6 (patch) | |
tree | 31b34683a80a659e76e2076865d76a77ef48dbea /plugin/etcd/lookup_test.go | |
parent | 3f6dfba1f0e9cd6c858f88891550d09904b7814d (diff) | |
download | coredns-8dbe1fbee227d6830d61a169eb947f4c243c76d6.tar.gz coredns-8dbe1fbee227d6830d61a169eb947f4c243c76d6.tar.zst coredns-8dbe1fbee227d6830d61a169eb947f4c243c76d6.zip |
Set SOA record TTL as min of TTL/MINIMUM (#2295)
* Set SOA record TTL as min of TTL/MINIMUM
According to
https://tools.ietf.org/html/rfc2308#section-3:
The TTL of this record is set from the minimum
of the MINIMUM field of the SOA record and the
TTL of the SOA itself, and indicates how long a
resolver may cache the negative answer.
Set the TTL accordingly so as to not always
negative cache SOA records for 300 seconds.
* Inline min func
* Update SOA record tests
* Fix types
Diffstat (limited to 'plugin/etcd/lookup_test.go')
-rw-r--r-- | plugin/etcd/lookup_test.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/plugin/etcd/lookup_test.go b/plugin/etcd/lookup_test.go index 68f654d34..d82b4bf18 100644 --- a/plugin/etcd/lookup_test.go +++ b/plugin/etcd/lookup_test.go @@ -81,7 +81,7 @@ var dnsTestCases = []test.Case{ Qname: "doesnotexist.skydns.test.", Qtype: dns.TypeA, Rcode: dns.RcodeNameError, Ns: []dns.RR{ - test.SOA("skydns.test. 300 SOA ns.dns.skydns.test. hostmaster.skydns.test. 0 0 0 0 0"), + test.SOA("skydns.test. 30 SOA ns.dns.skydns.test. hostmaster.skydns.test. 0 0 0 0 0"), }, }, // A Test @@ -126,7 +126,7 @@ var dnsTestCases = []test.Case{ // CNAME (unresolvable internal name) { Qname: "cname.prod.region1.skydns.test.", Qtype: dns.TypeA, - Ns: []dns.RR{test.SOA("skydns.test. 300 SOA ns.dns.skydns.test. hostmaster.skydns.test. 0 0 0 0 0")}, + Ns: []dns.RR{test.SOA("skydns.test. 30 SOA ns.dns.skydns.test. hostmaster.skydns.test. 0 0 0 0 0")}, }, // Wildcard Test { @@ -182,26 +182,26 @@ var dnsTestCases = []test.Case{ // CNAME loop detection { Qname: "a.cname.skydns.test.", Qtype: dns.TypeA, - Ns: []dns.RR{test.SOA("skydns.test. 300 SOA ns.dns.skydns.test. hostmaster.skydns.test. 1407441600 28800 7200 604800 60")}, + Ns: []dns.RR{test.SOA("skydns.test. 30 SOA ns.dns.skydns.test. hostmaster.skydns.test. 1407441600 28800 7200 604800 60")}, }, // NODATA Test { Qname: "a.server1.dev.region1.skydns.test.", Qtype: dns.TypeTXT, - Ns: []dns.RR{test.SOA("skydns.test. 300 SOA ns.dns.skydns.test. hostmaster.skydns.test. 0 0 0 0 0")}, + Ns: []dns.RR{test.SOA("skydns.test. 30 SOA ns.dns.skydns.test. hostmaster.skydns.test. 0 0 0 0 0")}, }, // NODATA Test { Qname: "a.server1.dev.region1.skydns.test.", Qtype: dns.TypeHINFO, - Ns: []dns.RR{test.SOA("skydns.test. 300 SOA ns.dns.skydns.test. hostmaster.skydns.test. 0 0 0 0 0")}, + Ns: []dns.RR{test.SOA("skydns.test. 30 SOA ns.dns.skydns.test. hostmaster.skydns.test. 0 0 0 0 0")}, }, // NXDOMAIN Test { Qname: "a.server1.nonexistent.region1.skydns.test.", Qtype: dns.TypeHINFO, Rcode: dns.RcodeNameError, - Ns: []dns.RR{test.SOA("skydns.test. 300 SOA ns.dns.skydns.test. hostmaster.skydns.test. 0 0 0 0 0")}, + Ns: []dns.RR{test.SOA("skydns.test. 30 SOA ns.dns.skydns.test. hostmaster.skydns.test. 0 0 0 0 0")}, }, { Qname: "skydns.test.", Qtype: dns.TypeSOA, - Answer: []dns.RR{test.SOA("skydns.test. 300 IN SOA ns.dns.skydns.test. hostmaster.skydns.test. 1460498836 14400 3600 604800 60")}, + Answer: []dns.RR{test.SOA("skydns.test. 30 IN SOA ns.dns.skydns.test. hostmaster.skydns.test. 1460498836 14400 3600 604800 60")}, }, // NS Record Test { @@ -218,7 +218,7 @@ var dnsTestCases = []test.Case{ // NS Record Test { Qname: "a.skydns.test.", Qtype: dns.TypeNS, Rcode: dns.RcodeNameError, - Ns: []dns.RR{test.SOA("skydns.test. 300 IN SOA ns.dns.skydns.test. hostmaster.skydns.test. 1460498836 14400 3600 604800 60")}, + Ns: []dns.RR{test.SOA("skydns.test. 30 IN SOA ns.dns.skydns.test. hostmaster.skydns.test. 1460498836 14400 3600 604800 60")}, }, // A Record For NS Record Test { @@ -230,7 +230,7 @@ var dnsTestCases = []test.Case{ }, { Qname: "skydns_extra.test.", Qtype: dns.TypeSOA, - Answer: []dns.RR{test.SOA("skydns_extra.test. 300 IN SOA ns.dns.skydns_extra.test. hostmaster.skydns_extra.test. 1460498836 14400 3600 604800 60")}, + Answer: []dns.RR{test.SOA("skydns_extra.test. 30 IN SOA ns.dns.skydns_extra.test. hostmaster.skydns_extra.test. 1460498836 14400 3600 604800 60")}, }, // A Record Test for backward compatibility for zone records { |