Python DNS Server

Tags: python dns twisted

I’ve spent a few hours over the last week working on a Python DNS server that uses a database to store name records. Reactions to this probably come in one of two flavors: “Cool!” or “Seriously, WTF, use an existing solution!”

If you immediately like the idea, download the source from bitbucket.

Still here? I guess I have some explaining to do.

I need a dynamic DNS server at home

Either a proper dynamic DNS server or at least a DNS server with some form of API will do. I work on some sysadmin software and other software that makes use of network services.

I never have fully grasped Twisted’s deferred model

Sure, I’ve written some code that uses Twisted, but it is ugly, and it never feels quite right or natural to me. I’d like to really wrap my head around that style of code.

The NomenPy project is my attempt to satisfy both of those needs. Twisted comes with a fully baked DNS implementation. This allows me to build out a programmable database backed DNS server as a thin veneer over a Twisted foundation. I can see real results while working on a real problem and learning a new style of programming.

With all of that said, understand that I’m a complete noob when writing code to fit Twisted’s model. If the code is an atrocious misuse of Twisted, please let me know what I did wrong. Much thanks in advance!