amuck-landowner

GeoDNS in PowerDNS

Nikki

New Member
Used to use PHP for this, but since this is a lot cleaner I figured I'd share it.

https://github.com/nikkiii/powerdns-geodns

You can try it out by resolving cdn.meow.tf, it'll return one of the following ips:

  • 199.19.227.51 (BuyVM, Las Vegas)
  • 199.195.250.46 (BuyVM, New Jersey)
  • 199.233.232.50 (QuickPacket, Atlanta)
  • 107.161.16.20 (RamNode, Seattle)
  • 37.187.20.216 (Kimsufi, France)
 

Nikki

New Member
PowerDNS already has a module for this. (http://www.debiantutorials.com/install-configure-powerdns-geo-backend-cdngeographic-dns-blancing/)

There is also another project that does this on a bigger scale, http://gdnsd.org/. A talk about about gDNSd, https://www.youtube.com/watch?v=WF75IGx9svM.
PowerDNS' module doesn't support distance calculations, only country. I was going to use gdnsd, I just don't feel like messing with it to set it up the way I want (sql backend and all), so I wrote this.
 

Francisco

Company Lube
Verified Provider
Blizten's setup always felt 'messy' anyway. It was a cool feature but for sure meh.

Pretty slick setup, though!

So how does powerdns talk with it then? Over the socket?

Francisco
 

Nikki

New Member
Blizten's setup always felt 'messy' anyway. It was a cool feature but for sure meh.


Pretty slick setup, though!


So how does powerdns talk with it then? Over the socket?


Francisco
PowerDNS supports different backends, one of them (which I used to use) being pipe which executes a command, and this one which was added in 3.2, which can use HTTP, Sockets, etc with JSON/RPC https://doc.powerdns.com/md/authoritative/backend-remote/ - Did some research and it's said that Unix sockets are the fastest and it's probably right, though you could easily use HTTP/TCP/ZeroMQ
 
Last edited by a moderator:

InertiaNetworks-Ryan

New Member
Verified Provider
The reason why UNIX sockets are faster is because theres no networking overhead. It's a point to point connection.

By that point you can just use those capabilities built into gdnsd to accomplish the same thing without external scripts. I only see your script usable in big countries like the U.S., Canada, Russia and Australia.

It seems like you're recreating this though, http://turtle.dereferenced.org/~kaniini/demo/jsoncb.html

I personally use powerdns's pipe backend with a ruby script that has the gem to parse it's protocol and return A records for our companies IP's when used in our stock rDNS format (ip-in-dashed-format.rdns.inertianetworks.net). That way I don't have to waste space in a database or generate the records myself for new blocks (just use what's needed). The IP's are filtered through our ARIN ORG-ID so it won't make valid rDNS's for other IP blocks besides our own.

There's more than one way to skin this cat I guess.
 
Last edited by a moderator:
Top
amuck-landowner