Skip to content

joewilliams/erl_geo_dns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

geo_dns : a simple geoip dns server

geo_dns is a small, prototype dns server that uses the maxmind geoip db to determine which ip associated with a dns record is the closest to the requesters ip address and serves that up as the ip address for the requested domain


author : joe williams <joe@joetify.com>


license : apache 2


building/starting : 

$ sudo apt-get install libgeoip-dev libgeoip1 erlang couchdb

* download geoip db, http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz

$ git clone git@github.com:joewilliams/erl_geo_dns.git

$ cd erl_geo_dns
$ make
$ erl -pa apps/*/ebin -s geo_dns

* for non-defaults adjust apps/geo_dns/ebin/geo_dns.app for the configuration (port, geo db, etc) you would like


creating records:

* each dns record is a document in couchdb (on localhost by default). the document format is the following:

_id : "test.com"
iplist : [[a,b,c,d],[a,b,c,d]]
ttl : 300

* note that the iplist field is an array of arrays where ip address octets are items in the internal arrays


caveats:

* this server has never been used in production and is mostly a proof of concept
* only supports A records


credits:

* bine : http://bitbucket.org/kuenishi/bine/src/
* libgeoip-erlang : http://bitbucket.org/mattsta/libgeoip-erlang/src/
* couchbeam : http://github.com/benoitc/couchbeam

About

fun with geoip and dns

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published