Question

I have a app that needs to connect over a socket to a remote computer that now has multiple IP addresses. Is there a way to turn the remote Hostname or IP a list of all the IPs that the system has?

Possibly (Hostname | Ip) => (RemoteMAC) => IPs?

These will be windows server 2003/2008 machines.

Was it helpful?

Solution

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

produces:

208.201.239.101
208.201.239.100

http://codeidol.com/other/rubyckbk/Internet-Services/Performing-DNS-Queries/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top