Tag: nslookup

在Ruby中反向DNS?

我的环境中有很多没有正确清点的计算机。 基本上,没有人知道哪个IP与哪个mac地址和哪个主机名相关。 所以我写了以下内容: # This script goes down the entire IP range and attempts to # retrieve the Hostname and mac address and outputs them # into a file. Yay! require “socket” TwoOctets = “10.26” def computer_exists?(computerip) system(“ping -c 1 -W 1 #{computerip}”) end def append_to_file(line) file = File.open(“output.txt”, “a”) file.puts(line) file.close end def getInfo(current_ip) […]