Monday, March 24, 2014

Simple ips to certain dns

172:rp young$ cat dns_ip.rb 
#!/usr/bin/env ruby
def check
 if ARGV[0] == nil
  abort 'please input ARGV[0]'
 end
end

check

require 'resolv'

def check_address
    Resolv.each_address(ARGV[0]) do |ip|
      puts ip
    end
end

check_address
172:rp young$ ruby dns_ip.rb naver.com
125.209.222.142
202.131.30.11
202.131.30.12
125.209.222.141
172:rp young$ 


No comments:

Post a Comment