0

複数の IP アドレスを持つリモート コンピューターにソケット経由で接続する必要があるアプリがあります。リモートのホスト名または IP を、システムが持つすべての IP のリストにする方法はありますか?

おそらく (ホスト名 | IP) => (RemoteMAC) => IP?

これらは Windows Server 2003/2008 マシンです。

4

1 に答える 1

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

生成:

208.201.239.101
208.201.239.100

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

于 2010-05-11T03:01:46.750 に答える