LoginSignup
0
0

More than 5 years have passed since last update.

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

Posted at

使い方

$ 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
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0