[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: TCPSocket.gethostbyname difficulties

Peter

9/29/2003 6:42:00 PM

1 Answer

Eric Hodel

9/29/2003 10:02:00 PM

0

Peter (Peter.Vanbroekhoven@cs.kuleuven.ac.be) wrote:

> > I think your DNS server manages to do the reverse lookup while ours can''t.
> > Is that possible? I don''t know anything about how reverse lookups work..
>
> I''ve just taken a look at the rfc1034. The section on inverse queries goes
> like this:
>

You seem to have missed a critical section of the RFC:

2. INTRODUCTION

This RFC introduces domain style names, their use for Internet mail
and host address support, and the protocols and servers used to
implement domain name facilities.

This RFC tells you how to implement a name server, not how to write
a zone file. Your quote is out of context.

> <quote>
> 3.7.2. Inverse queries (Optional)
>
> Name servers may also support inverse queries that map a particular
> resource to a domain name or domain names that have that resource.
> For example, while a standard query might map a domain name to
> a SOA RR, the corresponding inverse query might map the SOA RR
> back to the domain name.

This paragraph refers to any RR, not just to A RRs, for example,
if I have seveal TXT RRs that are "foo", I may be able to do an
inverse query on "foo" and get back all the records that have "foo"
as the TXT RR.

When I call TCPSocket.gethostbyname("cancer.org"), tcpdump gives this:

14:42:34.763284 localhost.4023 > localhost.domain: 40415+ AAAA? cancer.org. (28)
14:42:34.764176 localhost.domain > localhost.4023: 40415 0/1/0 (77)
14:42:34.765011 localhost.4024 > localhost.domain: 40416+ A? cancer.org. (28)
14:42:34.766352 localhost.domain > localhost.4024: 40416 2/4/4 A 0.0.0.0, A 209.135.47.118 (211)
14:42:34.768112 localhost.4025 > localhost.domain: 40417+ PTR? 0.0.0.0.in-addr.arpa. (38)
14:42:34.826762 localhost.domain > localhost.4025: 40417 NXDomain 0/1/0 (102)

Ruby is asking for the in-addr.arpa domain, which is covered in various
RFCs, see RFC1101 in particular. It is not performing an inverse query.

--
Eric Hodel - drbrain@segment7.net - http://se...
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04