0

I created DNS zone as in example below. Is there another, clean way to redirect subdomains to IP address? Maybe with bind9 $GENERATE? Can I use regex or iteration with existing DNS software? Where to start, and can DLZ (Dynamically Loadable Zones) solve that?

0-0 IN A 192.168.0.0
0-1 IN A 192.168.0.1
0-2 IN A 192.168.0.2
0-3 IN A 192.168.0.3

; ... SKIPPED 65k+ LINES

255-253 IN A 192.168.255.253
255-254 IN A 192.168.255.254
255-255 IN A 192.168.255.255
Tymek
  • 101
  • 3

1 Answers1

0

I am not so sure about your requirements.


DLZ. DLZ are Dynamically Loadable Zones. Per documentation, they allow to pull records from external driver.

dlz sample {
     database "dlopen driver.so <args>";
     [...]
};

zone "example.com" {
     type master;
     dlz sample
};

Said that, if you put your records in database; it is loading them from external database using driver.so. Remember, it is more like a patch; not a core functionality. It is also used as integration with SAMBA. Such database may slow response times from DNS server.


Stable solution. The fastest and the cleanest way for a moment is to manage Zone as a file. You can easily generate them with templating system, like Jinja2, and deploy with Ansible or Salt. There are set or roles available on the Internet:

It will help you generate reverse zone, validate your records and syntax completely automatically.

limakzi
  • 171
  • 4