multiple queries over a TCP socket

David Botham dns at botham.net
Wed Aug 21 16:26:33 UTC 2002


 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> -----Original Message-----
> From: bind-users-bounce at isc.org [mailto:bind-users-bounce at isc.org]
> On Behalf Of Martin H. Sluka
> Sent: Wednesday, August 21, 2002 9:48 AM
> To: comp-protocols-dns-bind at isc.org
> Subject: multiple queries over a TCP socket
> 
> I have to do a lot of DNS queries for records under a variety of
> TLDs from a (Perl) CGI script, using a BIND nameserver (9.2.1rc2)
> as
> resolver.  However, some of the authoritative servers involved may
> not be reachable, and I can only afford to wait a certain amount of
> time (one minute or so) before simply marking the outstanding
> answers as "server unreachable".
> 
> In order not to have to worry about lost UDP packets,
> retransmission etc. I tried to use a TCP socket to talk to my
> resolver.  While this works in principle, I realized that
> unexpectedly the answers to my queries came in the order of the
> queries, that is, if the resolver cannot get an answer to one of my
> queries, I don't get answers for any of the subsequent queries,
> too. :-/

If you are using perl and Net::DNS module, look at the bgsend method
sending your queries (used in conjunction with bgread and
bgisready...)

http://search.cpan.org/author/CREIN/Net-DNS-0.28/lib/Net/DNS/Resolver.
pm

It sends the queries in the background...

Dave...

> 
> So, my question is: Is there any way to circumvent this (still
> using a single TCP socket), or do I have to change to UDP with all
> the side- effects mentioned above?
> 
> Regards,
> fany.
> 
> --
> .___________________________________________.                      
>  _ 
> | noris network AG  | tel +49 911 93 52-112 | ASCII ribbon campaign
> | ( ) Kilianstrasse 142 | fax +49 911 93 52-100 |  - against HTML
> | email  X D-90425 Nuernberg | http://www.noris.net/ |             
> | & vcards / \ 

-----BEGIN PGP SIGNATURE-----
Version: PGP 7.0.4

iQA/AwUBPWO/OFq85iiiMQ4EEQIGZgCbB6eYpjiOa6T2RbKBmJBBVfRbAwkAn1Yt
FWXLNCycJ3vfUUWIzYcqBoaW
=dHqj
-----END PGP SIGNATURE-----



More information about the bind-users mailing list