}
if(!haveTTL && !haveQTYPE && isTimeSpec(nextpart)) {
rr.ttl=makeTTLFromZone(nextpart);
+ if(!d_havedollarttl)
+ d_defaultttl = rr.ttl;
haveTTL=true;
// cout<<"ttl is probably: "<<rr.ttl<<endl;
continue;
rr.content+=std::to_string(makeTTLFromZone(recparts[n]));
else
rr.content+=recparts[n];
-
- if(n==6 && !d_havedollarttl)
- d_defaultttl=makeTTLFromZone(recparts[n]);
}
break;
default:;
--- /dev/null
+#!/bin/sh
+
+${ZONE2JSON} --zone=zone2json-rfc2308/rfc2308.com --zone-name=example.com
--- /dev/null
+This test verifies that we implement implicit TTL according to RFC2308.
\ No newline at end of file
--- /dev/null
+{"name": "example.com", "records": [{"content": "ns1.example.com marka.isc.org 0 0 0 0 1", "name": "example.com.", "prio": 0, "ttl": 7200, "type": "SOA"}, {"content": "127.0.0.1", "name": "www.example.com.", "prio": 0, "ttl": 7200, "type": "A"}, {"content": "ns1.example.com", "name": "example.com.", "prio": 0, "ttl": 7200, "type": "NS"}, {"content": "127.0.0.1", "name": "ns1.example.com.", "prio": 0, "ttl": 7200, "type": "A"}, {"content": "127.0.0.2", "name": "ns2.example.com.", "prio": 0, "ttl": 3600, "type": "A"}, {"content": "127.0.0.3", "name": "ns3.example.com.", "prio": 0, "ttl": 86400, "type": "A"}]}
--- /dev/null
+@ IN 7200 SOA ns1 marka.isc.org. (0 0 0 0 1)
+www IN A 127.0.0.1
+@ NS ns1
+ns1 A 127.0.0.1
+$TTL 3600
+ns2 A 127.0.0.2
+ns3 IN 86400 A 127.0.0.3
+
export NSEC3DIG=${NSEC3DIG:-${PWD}/../pdns/nsec3dig}
export SAXFR=${SAXFR:-${PWD}/../pdns/saxfr}
export ZONE2SQL=${ZONE2SQL:-${PWD}/../pdns/zone2sql}
+export ZONE2JSON=${ZONE2JSON:-${PWD}/../pdns/zone2json}
export ZONE2LDAP=${ZONE2LDAP:-${PWD}/../pdns/zone2ldap}
export PDNSUTIL=${PDNSUTIL:-${PWD}/../pdns/pdnsutil}
export PDNSCONTROL=${PDNSCONTROL:-${PWD}/../pdns/pdns_control}