Arbitrary DNS queries?

Hi,

how can someone do arbitrary DNS queries (like c library function
res_query) in ruby?

regards
Hadmut

···


Hadmut Danisch http://www.danisch.de

require ‘socket’
IPSocket.getaddress(hostname)

See also:
http://www.rubycentral.com/book/lib_network.html

Jason Creighton

···

On Sat, 24 May 2003 10:43:14 +0200 Hadmut Danisch spamblock@danisch.de wrote:

Hi,

how can someone do arbitrary DNS queries (like c library function
res_query) in ruby?

Jason Creighton wrote:

require ‘socket’
IPSocket.getaddress(hostname)

See also:
http://www.rubycentral.com/book/lib_network.html

Nope, this is good for A RR only. But there are much
more Record Types, and I need to read the raw answer of new
record types (e.g. APL and RMX).

Hadmut

Sorry, I’m not a C coder: I should have looked at the manpage for res_query
before responding.

Jason Creighton

···

On Sat, 24 May 2003 22:45:14 +0200 Hadmut Danisch spamblock@danisch.de wrote:

Jason Creighton wrote:

require ‘socket’
IPSocket.getaddress(hostname)

See also:
http://www.rubycentral.com/book/lib_network.html

Nope, this is good for A RR only. But there are much
more Record Types, and I need to read the raw answer of new
record types (e.g. APL and RMX).

Use resolv.rb from the ruby 1.8 source.

Cheers,
Sam

Quoteing spamblock@danisch.de, on Sun, May 25, 2003 at 05:51:21AM +0900:

···

Jason Creighton wrote:

require ‘socket’
IPSocket.getaddress(hostname)

See also:
http://www.rubycentral.com/book/lib_network.html

Nope, this is good for A RR only. But there are much
more Record Types, and I need to read the raw answer of new
record types (e.g. APL and RMX).

Hadmut

Use resolv.rb from the ruby 1.8 source.

Cheers,
Sam

Quoteing spamblock@danisch.de, on Sun, May 25, 2003 at 05:51:21AM +0900:

···

Jason Creighton wrote:

require ‘socket’
IPSocket.getaddress(hostname)

See also:
http://www.rubycentral.com/book/lib_network.html

Nope, this is good for A RR only. But there are much
more Record Types, and I need to read the raw answer of new
record types (e.g. APL and RMX).

Hadmut

Quoteing sroberts@uniserve.com, on Thu, May 29, 2003 at 01:31:51AM +0900:

Use resolv.rb from the ruby 1.8 source.

Actually, it’s in ruby 1.6 as well.

Sam