Posted at

DNSの更新反映を自動的に定期的にチェックするスクリプト

More than 5 years have passed since last update.


使い方

$ ruby dns_retry.rb google.com

require 'net/dns'

require 'nsnotify'

target = ARGV[0]

puts "Start retry..."
puts Net::DNS::Resolver.start(target)

loop do
print "."

ans = Net::DNS::Resolver.start(target).answer
if ans.count > 0
Nsnotify.notify "Found", ans.join(" / ")
break
end

sleep 60
end