Bind9 API
From: https://www.zytrax.com/books/dns/ch12/
Chapter 12. BIND API(s)
If you are interested in generic API for DNS then you may want to consider
get-dns which defines a thorough (read complex) DNS api set with a number of
language bindings.
Many users especially those with a substantial number of zones or zones which
are very dynamic find the process of updating text zone files a little tedious.
Further, for updates to take effect BIND must be stopped/started - a slightly
arcane process - or rndc used to reload the zone. What if we could
update BIND on the fly?
Well you kinda can if you are prepared to do some fairly serious hacking.
You have basically three choices, two from BIND and one third party add-on to
BIND:
- BIND 9's Full function API - this involves replacing the entire internal ram
based database of BIND. Not for the squeamish or faint-hearted.
- BIND 9's SDB API - a relatively trivial interface that allows zone file
records to be supplied via a callback interface.
- BIND-DLZ API (implemented as a BIND 9 patch) - this interface allows for
both the dynamic modification of zone records on the fly and the addition of
zones dynamically (this latter feature is NOT available in either of the current
BIND APIs).
The documentation for the last of the three seems fairly complete and may be
obtained from the web site above. It will not be discussed further but its
dynamic zone addition make it both unique and compelling. The downside is that
it is not currently integrated with BIND 9 - but the web site makes a number of
reference to attempts to integrate with the BIND project and the project sponsor
is a also a sponsor of BIND which may increase the chances of success.
Finally, documentation on either of BINDs APIs is as rare as hen's teeth. You
have been warned.
BIND APIs
BIND provides two APIs. A high function API (we'll call it the hfdb) that allows
the 'plug-in' to replace BIND's internal database function for nominated zones
and, from BIND verion 9.1 onward, a Simple Database API (sdb) that allows BIND
to read files from alternate sources.
It is important to note before contemplating using either of these APIs that
they are statically linked, simply put this means that you will need to edit the
BIND source files and makefile.in and then re-build BIND including your source
and header files. If anything goes wrong in your routines its your problem and
your fault. There is no supervisory functionality provided by BIND. This is
unlike, say, Apache where modules can be dynamically loaded and some supervisory
functions are provided.
High Function Database API (hfdb)
The definitive reference for the hfdb is the commented C header file db.h which
is located in the directory bind-release/lib/dns/include/dns/db.h where
bind-release should be replaced with the location and version number where you
unpacked the source distribution e.g. /usr/src/bind/9.2.2.
under construction
Simple Database API (sdb)
The definitive reference for the sdb is the commented C header file sdb.h which
is located in the directory bind-release/lib/dns/include/dns/sdb.h where
bind-release should be replaced with the location and version number where you
unpacked the source distribution e.g. /usr/src/bind/9.2.2.
The simple database API provides the following functionality
under construction