文件管理器 ruby-pdns
fmms
13年前
<p>ruby-pdns 是一个简单的Ruby库用来开发动态基于 PowerDNS的DNS记录应用,它将复杂的DNS操作过程封装起来并提供简单易用的方法,示例代码如下所示:</p> <pre class="brush:ruby; toolbar: true; auto-links: false;">module Pdns newrecord("www.your.net") do |query, answer| case country(query[:remoteip]) when "US", "CA" answer.content "64.xx.xx.245" when "ZA", "ZW" answer.content "196.xx.xx.10" else answer.content "78.xx.xx.140" end end end</pre> <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1327574442061" target="_blank">http://www.open-open.com/lib/view/home/1327574442061</a></p>