Domanda

Ho un app che ha bisogno di connettersi su un socket a un computer remoto che ora ha più indirizzi IP. C'è un modo per trasformare il nome host remoto o IP un elenco di tutti gli IP che il sistema ha?

Possibilmente? (Nome host | Ip) => (RemoteMAC) => IP

Questi saranno server Windows 2003/2008 macchine.

È stato utile?

Soluzione

require 'resolv-replace'
Resolv::DNS.new.each_address("oreilly.com") { |addr| puts addr }

produce:

208.201.239.101
208.201.239.100

http://codeidol.com/other/rubyckbk/ Internet-Servizi / Performing-DNS-query /

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top