I am currently writing a BIND sdb driver on my Ubuntu machine. As a
simple first step, I created a nearly empty driver that only implements
lookup, and returns a hardcoded IP address every time. I then compiled,
installed, and ran my new named nameserver. I edited my
named.conf.local file to use my new database driver for "foo.com", and
edited my resolv.conf file to include 127.0.0.1 (I don't run
resolvconf).

So, what happens when I run dig on foo.com? Well, it seems to correctly
resolve via my localhost nameserver, but I don't get any valid answers
(in fact, I get status: SERVFAIL in the response). The named process is
still running, however, so my driver didn't kill anything, it just
didn't return a correct A record via dns_sdb_putrr.

So, what should the data look like for a dns_sdb_putrr call? I
currently just pass "A", 3600, and a hardcoded IP address string
literal. Please advise as to what is correct. I have searched the
bind-users and bind9-users mail archives without any luck. A copy of my
minimal driver implementation follows. Thanks so much for your help.

static dns_sdbimplementation_t *opencdndb = NULL;

static isc_result_t opencdndb_lookup(const char *zone, const char *name,
void *dbdata, dns_sdblookup_t *lookup)
{
UNUSED(zone);
UNUSED(dbdata);

isc_result_t result;
result = dns_sdb_putrr(lookup, "A", 3600, "65.254.250.110");
return result;
}

static dns_sdbmethods_t opencdndb_methods =
{
opencdndb_lookup,
NULL, /* authority */
NULL, /* allnodes */
NULL, /* create */
NULL /* destroy */
};

isc_result_t opencdndb_init(void)
{
unsigned int flags = 0;
return (dns_sdb_register("opencdn", &opencdndb_methods, NULL, flags,
ns_g_mctx, &opencdndb));
}

void opencdndb_clear(void)
{
if(opencdndb != NULL)
dns_sdb_unregister(&opencdndb);
}