Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


GeoDNS backend for PowerDNS
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

GeoDNS backend for PowerDNS

KuroKuro Member
edited October 2012 in General

I'm wondering if there's any interest among fellow LET users for a new GeoDNS backend for PowerDNS?

I've used PowerDNS's geo backend for a few months and there are quite a few issues I had with it. The configuration is a bit clunky, it was designed around being on a separate set of DNS servers from the servers that handle the apex / rest of the domain. It works not by returning A records, but by returning CNAMEs that you would setup your round robins on elsewhere. You must manually go through a long list of every country and specify which CNAME record to return for each one. It only works at the country level, so there is no separation between the east and west coasts of the US.

I've also used gdnsd for a few months. Its configuration was much simpler, as it works by you defining the coordinates (latitude/longitude) for each 'datacenter' for which you can group multiple IPs. It automattically picks the closest datacenter to the client for which to return the IPs of based on the distance between the coordinates of the datacenters and the clients IP. The first downside I noticed (and a major one for me) is that it will only return the IPs of one datacenter at a time. Going by its documentation, it was clearly designed around having multiple servers (redundant load balancers even) at each datacenter. Another thing that might be a downside for some people here is that it currently only supports RFC1035 zone files (no web panel).

I ended up deciding to write my own backend for PowerDNS. It's still currently in it's early stages, though I already have a version I'm rolling out onto my production nameservers for testing. If there's enough demand for it I'll clean up the code some and release it as Free & Open Source.

Features it currently supports:
1. Simple configuration: just insert your IP's and location info
2. Automagically calculates which servers are the closest to the client based on the coordinates (similar to gdnsd)
3. Returns the 3 closest IPs IN ORDER BY DISTANCE (so your clients always get connected to the closest server that's not down, not just a random one of the closest 3)
4. Uses MaxMind's GeoCity or GeoLiteCity (free) database
5. Only need to use the textfile configuration for the GeoDNS records, you can use PowerAdmin (or other web panel) for configuring all of your other records/domains.

Planned features to be added within the next week:
1. Overides based on the client's subnet, continent, country, region, or city
2. IPv6 / AAAA
3. New config format for storing server IPs/locations, as well as overides and other new settings.
4. System uptime checking: check servers at defined intervals to see if they're online or not, using either ping or connecting to a TCP socket. After defined amount of consecutive failed checks, automatically remove the IP from the pool until a defined amount of consecutive checks succeed.

Thanked by 1didebuli

Comments

  • I would be interested in this if it is better than the current backend as described.

  • gbshousegbshouse Member, Host Rep

    @Kuro - GeoDNS based on coordinates and straight line calculation is pointless (for example for north France the closest servers will be in south UK and not in Paris which is weird). Feel free to play with our extended version of PowerDNS - we have added small patch which allows you to pass client's IP to database backend so you can implement GeoDNS staff using MySQL geo formats and so. Our launchapd repo is available here - version 3.1-4ubuntu1ppa12 is the stable one for Ubuntu 12.04

  • I have setup the geo-dns with BIND by its views and ACLs.
    The problem is when views become many, maintaining the nameservers is hard.

  • gbshousegbshouse Member, Host Rep

    That's why the best option is to move the calculation to database backend :)

  • @gbshouse I'm quite aware of that, hence the ability to add overrides based on countries or regions. I'm not sure if it's changed, but when I first tried your DNS service, I would have to manually add a record for each country. The coordinate based system gives a decent default that can be fine tuned as needed.

  • gbshousegbshouse Member, Host Rep

    @Kuro - it's not per country bu per georegion see documentation here and here. Beside that our georegions are nested.

  • @gbshouse OK, so a bit easier to configure than I remember.

    Anyways, this is about self hosted DNS, not 3rd party hosted DNS services.

  • gbshousegbshouse Member, Host Rep

    @gbshouse said: we have added small patch which allows you to pass client's IP to database backend so you can implement GeoDNS staff using MySQL geo formats and so. Our launchapd repo is available here - version 3.1-4ubuntu1ppa12 is the stable one for Ubuntu 12.04

    Just write MySQL UDF with Maxmind databases that's all

  • I would be interested. What is the backend created in?

  • @Damian said: What is the backend created in?

    Currently it's written in Perl, and communicating with PowerDNS via pipes. If there's enough interest in this backend I wouldn't mind rewriting it in C as a native PowerDNS module :)

  • sounds interested.

  • geekalotgeekalot Member
    edited October 2012

    @Kuro, I am very interested in this. I would be willing to review code/test as I have a number of VPS's connected via mysql replication and I am looking for an independent GeoDNS/GSLB solution I can host myself for my own purposes.

    ("Planned feature" #4 uptime or health checking is critical to incorporate for "high availability")

  • Yes @Kuro!

    Very interested in seeing/using/testing what you have created.

    Been longing for such a solution. What is out there isn't adequate and clunky.

    Let me know how to get involved and I'll get out installations using it and testing it.

  • After a few weeks of not finding the motivation to work on any of my projects... I'm back, and with good news. :)

    I worked on this project for a good few hours the night before last, and got a good bit done before sleepiness/coders block kicked in. :p

    I'm currently finishing up from where I left off the other night, hope to roll out this update to my servers by morning, and if all goes well an open source (license undecided at this time) alpha release plus some minimal documentation sometime tomorrow.

    If anyone has any ideas for a project name I'd love to hear them, as I'm honestly quite terrible at naming things... <_<;

  • KuJoeKuJoe Member, Host Rep
    edited November 2012

    @Kuro GeoPowereDNS

  • @KuJoe said: @Kuro GeoPowereDNS

    @KuJoe Did you intend for that 'e' to be in there before the 'D' or did you intend for that to be "GeoPowerDNS"?

  • geekalotgeekalot Member
    edited November 2012

    @Kuro your timing is good as I need to find another GSLB solution.

    Ready to test, let me know.

  • KuJoeKuJoe Member, Host Rep

    @Kuro The idea was a play on "GeoDNS" and "PowerDNS" which I turned into "Geo Powered DNS" (dropped the d in Powered and used the D in DNS).

  • @KuJoe Ahh, I had thought of that after my previous reply. :P

  • @ those interested in this:

    How important is region based (ie. country/region/city) configuration to you? Would just the default coordinate distance calculations plus subnet overrides be enough for you?

    The reason I ask this, is because the region-based overrides, in theory, won't be very efficient.

  • I'm interested in this. I use maxmind's geo-country-region db and find it quite useful actually. It'a also blazing fast to lookup.. i think you'd need to have region configuration at least (city i don't care about as much) for this to be useful..

  • The city dataset really inflates the records to compare. Haven't had such good luck working with the raw data in a database and getting results in low times we expect.

    That's why the country level data is so commonly used instead.

    But, I see the need for the city level for some folks. Especially the states/regions info in places like the United States.

  • geekalotgeekalot Member
    edited November 2012

    @kuro Region based (city level) can be important (particularly for North America for my purposes).

    If it requires more effort and resources, it could be a premium offering (but still "free for life" for your Beta Tester ;-)

    IOW, get something working that we can play with while you explore that functionality.

Sign In or Register to comment.