]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Corrected host-0 and host-1 records.
authortcely <tcely@users.noreply.github.com>
Thu, 3 Aug 2017 08:54:34 +0000 (04:54 -0400)
committertcely <tcely@users.noreply.github.com>
Thu, 24 May 2018 17:33:47 +0000 (13:33 -0400)
I initially didn't notice that these were being overwritten, there are
just so many host-N entries in example.com.

modules/luabackend/test/powerdns-luabackend.lua

index 3e2653aaa900fdc182bccf1bd583880ac9715556..42cf54dcdb019d8876d2e5701f7af82b49d9df09 100644 (file)
@@ -332,17 +332,22 @@ end
 domains[origin].records["toomuchinfo-b."..origin] = tab
 tab = nil
 
-for n = 0, 19999, 1 do
-    domains[origin].records["host-"..n.."."..origin] = {
-        {qtype = "A", ttl = ttl, content = "192.168.1."..( n % 256)}
-    }
-end
 domains[origin].records["host-0."..origin] = {
+    {qtype = "A", ttl = ttl, content = "192.168.1.0"}
     {qtype = "EUI48", ttl = ttl, content = "00-50-56-9b-00-e7"},
 }
 domains[origin].records["host-1."..origin] = {
+    {qtype = "A", ttl = ttl, content = "192.168.1.1"}
     {qtype = "EUI48", ttl = ttl, content = "00-50-56-9b-00-e7-7e-57"},
 }
+local hnfmt = "host-%d.%s"
+local ipfmt = "192.168.1.%d"
+for n = 2, 19999, 1 do
+    domains[origin].records[hnfmt:format(n, origin)] = {
+        {qtype = "A", ttl = ttl, content = ipfmt:format( n % 256)}
+    }
+end
+
 domains[origin].records["rhs-at-expansion."..origin] = {
     {qtype = "CNAME", ttl = ttl, content = origin},
 }