Few questions on Bind
cswiger at mac.com
Thu Jan 5 00:30:39 UTC 2017
On Jan 4, 2017, at 4:11 PM, Debarghya Mandal <debarghya.mandal at gmail.com> wrote:
> I am kind of new to bind. I have a few queries about it.
> 1. Is there a way to load custom DNS record from zone file?
Yes; that's exactly what zone files are for.
> I have some schematized data that I can store say in json or xml format. I want bind to load that custom record.
If you have the data in a structured format, simply process that into the zone file format used by BIND. Or, you might consider alternatives like PowerDNS which provides more explicit support for backends like databases, LDAP, json, and so forth.
> 2. Once bind loads that data, for certain zones, for A/AAAA/CNAME request types I want bind to call my custom code which knows how to process that custom record and return a valid A/AAAA/CNAME record.
> DynDB extension is the best way to add a plugin to bind or there is some other alternative?
Start with dynamic zones and update the specific records via nsupdate. Use views to provide different answers to different classes of requestors if absolutely needed.
You should remember that DNS requests tend to be extensively cacheable, so trying to provide different answers to the same query isn't going to work unless you use very short TTLs, and even then clients may still enforce a minimum TTL of 5 minutes or so.
(Even BIND itself had a min_cache_ttl set to a default of 300 seconds, way back when.)
More information about the bind-users