OpenDNS discussion part 3, building a custom DNS solution

June 18, 2013 at 8:26 pm Leave a comment

In my last entry, I talked about creating a custom solution to get the advantages of OpenDNS’s filtering capabilities, while still getting access to CDN servers that are located in your neighborhood.

Since I didn’t want to re-invent the wheel and write my own DNS server, I started out by looking at open-source DNS servers.  I found a few, but a good many of the ones out there weren’t well maintained, or building them for Windows was daunting.  (Yes, I run Macs, but I wanted to run this on a Windows box that serves as my Plex server.)

I have previous experience with a Windows DNS server called SimpleDNS Plus.  It’s not open-source, nor is it free, but it is a very good Windows DNS server that does have a plug-in architecture so that you can build your own plug-ins.

They have a screencast showing how to build a basic plug-in for SimpleDNS 5.0/5.1, but the current version is 5.2, and there have been some changes that make those screencasts obsolete.  After sending a few emails to support explaining what I wanted to do, then asking for more information, I got a good reply telling me how I would implement my idea as a plug-in, but they were not willing to provide any further documentation than what was already on their website.  No example projects or anything.  Disappointed at the lack of assistance from the devs, and severely out of practice with C#, I started trying to hack away at it.

I’ll skip all the boring stuff that took a few days to get through…  I used an open-source .NET library to perform my DNS lookups, but had to embed it in my project because I was unable to use any additional assemblies from my .dll.  I’m not sure if that was a restriction of the plug-in, or something I wasn’t doing right, but I finally got a version of it working on my home network.

The way it worked was to perform a lookup against OpenDNS for every request it was sent.  I had hoped that SimpleDNS Plus would cache my answer, and look in the cache before sending the request to my plug-in, but that’s not the way SimpleDNS handles plug-ins.

So, I wrote a rudimentary caching system.  It doesn’t obey the TTLs, simply building up and emptying on a regular schedule, but it works.  Once my plug-in has resolved an address, it will skip lookups for that address, and just let Simple DNS Plus handle the resolution, unless it was a “blocked” site, in which case it will direct you to the blocked website.

My result?  We’ll it seems to work well enough for personal use…  I’ve ran GRC’s DNS Bench against it, and if it’s benchmarked against the default list, it is (predictably) slower, but reliable… However, if you remove all the others and only benchmark SimpleDNS Plus with my plug-in, it has some reliability issues…  Like down around 75-85% reliable, though I’m not 100% what the figure is telling me, exactly.  With my plug-in turned, off, I’m sitting at 100% reliability, so it’s definitely something I’m not doing right… It could also be the DNS Client library I’m using, I suppose…

It’s not terrible, but I’m a perfectionist, so I’m still trying to figure out why the performance isn’t as good as I’d like it to be…

Update:Woohoo!  A few hours after this blog entry was published, I cracked it.  I replaced the open-source .NET DNS Client library I was using with the library from ARSoft.Tools.Net, and now it works wonderfully well!  The GRC DNS bench tool now shows 100% reliability after multiple tests.  Now, I just need to watch it and see if it is stable.


Entry filed under: Networking. Tags: , , , .

OpenDNS discussion part 2, Developing a solution YNAB Update – June wrap-up

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


June 2013
« May   Jul »

Most Recent Posts

%d bloggers like this: