Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (22 sloc) 0.888 kB
Ruby PDNS Pipe Backend
This is a framework for hosting specific records using Power DNS, you can code the logic
for these records in ruby, the framework takes care of the hard work like hosting your
code and speaking to PDNS.
A sample record code would be, this is all you would need to do to host foo.your.net in
PDNS and do GeoIP look ups and respond correctly
module Pdns
newrecord("foo.your.net", :type => :record) do |query, answer|
answer.qtype :A
answer.ttl 600
case country(query[:remoteip])
when "DE"
answer.content "1.2.3.4"
else
answer.content "4.3.2.1"
answer.content "1.2.3.4"
answer.content [:TXT, "Some TXT record for this response"]
end
end
end
The code is hosted on Google Code at http://code.google.com/p/ruby-pdns/ find more information
there
Jump to Line
Something went wrong with that request. Please try again.