local remote_ip, remote_port, local_ip
-local origin
+local origin, ttl
local domains = {}
-- shared state between lookup and get functions
)
end
+ttl = 3600
origin = "test.com."
domains[origin] = {
domain_id = 1 + #domains,
name = origin,
soa = {
+ ttl = ttl,
nameserver = "ns1."..origin,
hostmaster = "ahu.example.com.",
serial = 2005092501,
retry = 7200,
expire = 604800,
default_ttl = 86400,
- ttl = 3600,
},
records = {},
}
domains[origin].records[origin] = {
{qtype = "SOA", ttl = domains[origin].soa.ttl, content = content_from_soatab(domains[origin].soa) },
- {qtype = "NS", ttl = 120, content = "ns1."..origin },
- {qtype = "NS", ttl = 120, content = "ns2."..origin },
+ {qtype = "NS", ttl = ttl, content = "ns1."..origin},
+ {qtype = "NS", ttl = ttl, content = "ns2."..origin},
}
domains[origin].records["ns1."..origin] = {
{qtype = "A", ttl = 120, content = "10.11.12.14" },
}
+ttl = 120
origin = "example.com."
domains[origin] = {
domain_id = 1 + #domains,
name = origin,
soa = {
+ ttl = 100000,
nameserver = "ns1."..origin,
hostmaster = "ahu."..origin,
serial = 2017080201,
retry = 7200,
expire = 604800,
default_ttl = 86400,
- ttl = 3600,
},
records = {},
}
domains[origin].records[origin] = {
{qtype = "SOA", ttl = domains[origin].soa.ttl, content = content_from_soatab(domains[origin].soa) },
- {qtype = "NS", ttl = 120, content = "ns1."..origin },
- {qtype = "A", ttl = 120, content = "10.9.8.7" },
- {qtype = "AAAA", ttl = 120, content = "10:9:8::7" },
+ {qtype = "NS", ttl = ttl, content = "ns1."..origin},
+ {qtype = "A", ttl = ttl, content = "10.9.8.7" },
+ {qtype = "AAAA", ttl = ttl, content = "10:9:8::7" },
}
domains[origin].records["ns1."..origin] = {
{qtype = "A", ttl = 120, content = "10.9.8.6" },