Hello World!

This is the first post from the development team here at SingleHop. Luke, my co-developer, and I tend to stay pretty busy writing code, and when we do get a moment to talk to our co-workers we are so busy raving about javascript errors and mySQL queries that nobody really knows, or cares, what we’re talking about. This post will be in a similar vein - prepare to be nerded at!

We here at SingleHop owe much to the open-source movement. Like many of our clients, we use Linux on our administrative machines, and we run open-source software like MySQL and Apache on those machines. So, it makes us feel good to be able to give back to the open-source community.

We help out in small ways, of course, by submitting bug reports and participating in online development discussions. Unfortunately, however, most of the development around here is pretty specific to our operation, allowing our sales and technical staff keep better track of our thousands of servers, switches, clients, IP addresses and sticks of ram. This code is heavily customized and not really interesting as an open-source project. Every once in awhile, though, we do create a tool that seems generally useful, and when we do we’ll put it up here to make it available to the general public.

As you can imagine, we have a lot of DNS zones around here, us being a hosting company and all. We use industry-standard DNS server BIND to serve these DNS zones to the outside world. However, it was becoming quite a chore for us to keep track of all our zone files, and even more difficult to automate operations that require manipulating those files.

To solve our DNS problems, we decided to migrate to BIND DLZ, a patch to standard BIND which allows zones to be hosted in an SQL database. We wrote a nifty user interface to the database, and we set up the infrastructure which will, one day soon, allow our clients to manage their own reverse DNS entries or even host their zones on our servers.

However, when we finished setting up and testing this new system, we ran into a little snafu. There did not seem to be a readily available tool to migrate our existing zone files to our SQL database. After scouring the internet for such a tool, I decided to write one, which is available here for you if you are faced with a similar task:


DNS Parser Script
Creative Commons License.

This script is written in Python and operates as a finite-state automaton. We have successfully used it to migrate hundreds of zones, both normal and reverse. It spits out SQL statements in a format suitable for our own database layout, which hews pretty closely to the layout recommended by the DLZ website. Some customization may be required if you’re using it for your own DLZ database, but thanks to the beauty of Python, even someone who has never used the language before can probably find their way around the code.

This tool is being released under Creative Commons Attribution 3.0 license. Do what you want with it, give SingleHop credit, and, of course, use at your own risk. Or better yet, hire our management staff and let us take care of the rest!