[Nottingham] MySQL backed nameserver

Graeme Fowler graeme at graemef.net
Thu Nov 2 11:41:37 GMT 2006


Raph, all

On 02/11/2006 00:04, NLUG wrote:
> Me and my friend are working on a project that will involve updating DNS 
> records via a web interface. We are thinking of having Bind to work 
> directly with MySQL so that any zone updates would take effect immediately.
> Has anyone done this before? Does it require a lot of effort to get it 
> to work?

Yes, and yes :)

> Any good tutorials/links we can have a look at would be much appreciated!

It's a slightly esoteric thing to do, especially if you're sold on using 
BIND. But we'll come to that shortly :)

Don't forget that there are other flavours of DNS server out there, 
including:

1. MyDNS (ta for reminding me of that, james)
2. djbdns (which doesn't do MySQL) and variants (some of which do)

But...

> Graeme F.: maybe you could point us in the right direction...we're after 
> the same kind of system you worked on at HE ;-)

 From BIND 9.4.0b2, the DLZ code I used for the HE/123-reg/Pipex/WF 
nameservers has been included in the mainstream (albeit beta) BIND codebase.

In theory that means:

No more hacking in patches
Wider community support
Features get developed more quickly

In practice it means:

More people asking questions on the BIND-DLZ mailing list!

 From a historical point of view, the reason we went with the DLZ patch 
on a BIND system was because we already had in excess of half a million 
zones in BIND format and writing scripts to munge them into a DB was 
easier than writing scripts to turn them into djbdns format, only to 
have to write scripts to turn the djbdns stuff into a DB.

Also, people tend to have very coloured opinions of Bernstein's code 
(principally because he has very coloured opinions about everyone 
else's), and the people building the system at the time (me & Simon) 
understood BIND but not djbdns.

So you could either:

1. Go with BIND 9.4.0b2
2. Go with a BIND 9.3.x or 9.2.x release and use patches from 
bind-dlz.sourceforge.net for 9.2.x (or from projects.navynet.it for 9.3.x).
3. Use something else :)

In case (3) I would argue that using MySQL and DLZ is overkill for you 
(bear in mind we needed something fast because it was taking 22 hours to 
restart the server, and the main BIND process was hitting 3GB of 
physical memory and coughing); you probably want bog-standard zonefiles 
with an interface that can push in dynamic updates. As per Michael's 
suggestion, try Perl's Net::DNS module and the CGI module. You should be 
able to make that work far more quickly than a MySQL backended one!

Graeme



More information about the Nottingham mailing list