DNS record generator

OK… Joe didn’t completely answer my question. His link gives instructions that when followed produce invalid DNS records for a normal domain. But it demonstrated the basic syntax, so I was able to figure out how to make it work.

If you have a domain named test.net and you want to automatically generate resolvable DNS and reverse DNS names for IPs x.y.z.17-254, here are the settings:

In the master zone generator:
Type Range Address pattern Hostname pattern
A 17 - 254 $.z.y.x.test.net. x.y.z.$

In master reverse zone generator:
Type Range Address pattern Hostname pattern
PTR 17 - 254 $.z.y.x.in-addr.arpa. $.z.y.x.test.net.

This will produce successful DNS lookups for
x.y.z.17-254 mapping to 17-254.z.y.x.test.net and vice versa.

You can also just enter the instructions into the records file. Here is my entries to produce client IP addresses at lucketts.net. I first generated a subset domain called static.lucketts.net and its reverse so that my main domain file would not be messed with.

Master zone records file:
$generate 17-254 $.86.82.208.static.lucketts.net. A 208.82.86.$

Reverse zone file:
$generate 17-254 $.86.82.208.in-addr.arpa. PTR $.86.82.208.static.lucketts.net.

The lines in the records file will show up in the records generator to demonstrate the proper format. I can now nslookup 208.82.86.17 and get 17.86.82.208.static.lucketts.net as an answer, or I can nslookup 17.86.82.208.static.lucketts.net and get 208.82.86.17 as an answer, and I didn’t have to manually enter 240 addresses by hand to have this work for the larger range.

Hope this helps someone else.

Steve