Can I send multiple DNS queries over one TCP connection?

I would like to know whether it is possible to send more than one DNS query over the same TCP connection.

I am aware that DNS queries usually go over UDP and TCP is used for large requests and zone transfers only, no need to point it out. I want to make a bunch of DNS request over the same TCP connection. Is this possible?

Answers to this specific question hopefully referring to RFC or other reputable sources are greatly appreciated.
LVL 3
gremwellAsked:
Who is Participating?
 
Chris DentConnect With a Mentor PowerShell DeveloperCommented:

In theory you can continue sending queries over a single session and the server should continue to answer them.

This behaviour is suggested in RFC 1035 section 4.2.2:

http://www.ietf.org/rfc/rfc1035.txt

I've never actually tried to send queries down the same connection, my resolver closes down the TCP connection as soon as it's had a response from the server.

Chris
0
 
wdurrettCommented:
Hi gremwell.

Can you please provide a little more information on what you are attempting to do?

0
 
gremwellAuthor Commented:
Chris, I really appreciate you taking care to answer to the specific question I have asked.

PS. Yes, I also have not manage to simulate it with resolvers. Even if I run 'dig' in batch mode ('-f' command line key) it reopens the connection to every request. I trust there are some Perl modules will help.

0
 
Chris DentPowerShell DeveloperCommented:
Fingers crossed then :)

As far as I know Net::DNS does the same thing (one TCP connection per query), but it's been a very long time since I looked at it.

Chris
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.