mail us  |  mail this page

contact us
training  | 
tech stuff  | 

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:

  1. BIND 9's Full function API - this involves replacing the entire internal ram based database of BIND. Not for the squeamish or faint-hearted.
  2. BIND 9's SDB API - a relatively trivial interface that allows zone file records to be supplied via a callback interface.
  3. 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

Up Arrow



Problems, comments, suggestions, corrections (including broken links) or something to add? Please take the time from a busy life to 'mail us' (at top of screen), the webmaster (below) or info-support at zytrax. You will have a warm inner glow for the rest of the day.

Pro DNS and BIND by Ron Aitchison

Contents

tech info
guides home
dns articles
intro
contents
1 objectives
big picture
2 concepts
3 reverse map
4 dns types
quickstart
5 install bind
6 samples
reference
7 named.conf
8 zone records
operations
9 howtos
10 tools
11 trouble
programming
12 bind api's
security
13 dns security
bits & bytes
15 messages
resources
notes & tips
registration FAQ
dns resources
dns rfcs
change log

Creative Commons License
This work is licensed under a Creative Commons License.

If you are happy it's OK - but your browser is giving a less than optimal experience on our site. You could, at no charge, upgrade to a W3C STANDARDS COMPLIANT browser such as Firefox

Search

web zytrax.com

Share

share page via facebook tweet this page

Page

email us Send to a friend feature print this page Decrease font size Increase font size Display full width page

Resources

Systems

FreeBSD
NetBSD
OpenBSD
DragonFlyBSD
Linux.org
Debian Linux

Software

LibreOffice
OpenOffice
Mozilla
GitHub
GNU-Free SW Foundation
get-dns

Organizations

Open Source Initiative
Creative Commons

Misc.

Ibiblio - Library
Open Book Project
Open Directory
Wikipedia

Site

CSS Technology SPF Record Conformant Domain
Copyright © 1994 - 2017 ZyTrax, Inc.
All rights reserved. Legal and Privacy
site by zytrax
Hosted by super.net.sg
web-master at zytrax
Page modified: October 21 2015.