Networking Forums

Networking Forums > Computer Networking > Linux Networking > DNS requests switch from UDP to TCP

Reply
Thread Tools Display Modes

DNS requests switch from UDP to TCP

 
 
muxaul@lenta.ru
Guest
Posts: n/a

 
      04-18-2005, 01:12 PM
Hello everybody,

I have witnessed a strange behavior of my machine and would like
to understand what has been happening. The situation is as follows.
My machine, which is online 24/7, uses fwlogwatch to generate daily
reports about connection attempts. I use a switch that makes
fwlogwatch try to resolve IP addresses, so that it sends requests
to an exterior DNS server when preparing a report. Usually, these
requests use UDP. Still, I have seen several times it using TCP
for these queries. My question is: What can make a program use TCP
for DNS requests?

Thanks!

Mikhail

 
Reply With Quote
 
 
 
 
Trygve Selmer
Guest
Posts: n/a

 
      04-18-2005, 01:35 PM
(E-Mail Removed) wrote:
> Hello everybody,
>
> I have witnessed a strange behavior of my machine and would like
> to understand what has been happening. The situation is as follows.
> My machine, which is online 24/7, uses fwlogwatch to generate daily
> reports about connection attempts. I use a switch that makes
> fwlogwatch try to resolve IP addresses, so that it sends requests
> to an exterior DNS server when preparing a report. Usually, these
> requests use UDP. Still, I have seen several times it using TCP
> for these queries. My question is: What can make a program use TCP
> for DNS requests?


When the packet is too big for UDP, DNS automatically switch to TCP for
that request.


 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      04-18-2005, 10:33 PM

"Trygve Selmer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> When the packet is too big for UDP, DNS automatically switch to TCP for
> that request.


Some smart programs also switch to UDP if they are seeing packet loss
issues. TCP is much better than UDP at dealing with this.

DS


 
Reply With Quote
 
muxaul@lenta.ru
Guest
Posts: n/a

 
      04-19-2005, 12:07 PM
Thank you for the reply. I would like to clarify it if possible.
Do you mean that this is the machine that sends a DNS
request `decides' whether to use UDP or TCP? The point
is that this was _my_ machine, not the DNS server that
was switching UDP to TCP.

 
Reply With Quote
 
Trygve Selmer
Guest
Posts: n/a

 
      04-19-2005, 01:04 PM
(E-Mail Removed) wrote:
> Thank you for the reply. I would like to clarify it if possible.
> Do you mean that this is the machine that sends a DNS
> request `decides' whether to use UDP or TCP? The point
> is that this was _my_ machine, not the DNS server that
> was switching UDP to TCP.


Normally your machine sends an UDP request to the server, and you get an
UDP response back. If the response is too big to fit into one UDP
packet, the server will return an indication of this. The client (your
machine) then retries the request, this time using TCP.


 
Reply With Quote
 
muxaul@lenta.ru
Guest
Posts: n/a

 
      04-19-2005, 02:04 PM

Trygve Selmer wrote:
> (E-Mail Removed) wrote:
> > Thank you for the reply. I would like to clarify it if possible.
> > Do you mean that this is the machine that sends a DNS
> > request `decides' whether to use UDP or TCP? The point
> > is that this was _my_ machine, not the DNS server that
> > was switching UDP to TCP.

>
> Normally your machine sends an UDP request to the server, and you get

an
> UDP response back. If the response is too big to fit into one UDP
> packet, the server will return an indication of this. The client

(your
> machine) then retries the request, this time using TCP.


Oh, thanks! I've got it.

Still, there seems to be an issue related to firewalling.
AFAIK, a common practice of protecting DNS servers is to
accept UDP requests from anyone but accept TCP requests
from a limited number of `upper-level' DNS servers only
(those that really need to transfer your zone). For all
other clients, TCP queries are prohibited. Thus, there
seems to be a collision between firewall rules and the
protocol suggested by the DNS server itself.

Mikhail

 
Reply With Quote
 
Trygve Selmer
Guest
Posts: n/a

 
      04-19-2005, 03:35 PM
(E-Mail Removed) wrote:
> Trygve Selmer wrote:
>
>>(E-Mail Removed) wrote:
>>
>>>Thank you for the reply. I would like to clarify it if possible.
>>>Do you mean that this is the machine that sends a DNS
>>>request `decides' whether to use UDP or TCP? The point
>>>is that this was _my_ machine, not the DNS server that
>>>was switching UDP to TCP.

>>
>>Normally your machine sends an UDP request to the server, and you
>>get an UDP response back. If the response is too big to fit into
>>one UDP packet, the server will return an indication of this. The
>>client (your machine) then retries the request, this time using TCP.

>
> Oh, thanks! I've got it.
>
> Still, there seems to be an issue related to firewalling.
> AFAIK, a common practice of protecting DNS servers is to
> accept UDP requests from anyone but accept TCP requests
> from a limited number of `upper-level' DNS servers only
> (those that really need to transfer your zone). For all
> other clients, TCP queries are prohibited. Thus, there
> seems to be a collision between firewall rules and the
> protocol suggested by the DNS server itself.


On an official server, you normally use tcp-ports other than 53 to
transfer zones between trusted servers. Port 53 (udp and tcp) normally
are reserved for client requests and prohibits zone transfers. And if
the zone is set up correctly, there should not be any need for tcp
requests/responses :-)

I will recommend the book "DNS and BIND" 4th edition from O'Reilly.

 
Reply With Quote
 
Rick Jones
Guest
Posts: n/a

 
      04-19-2005, 05:09 PM
(E-Mail Removed) wrote:
> Still, there seems to be an issue related to firewalling. AFAIK, a
> common practice of protecting DNS servers is to accept UDP requests
> from anyone but accept TCP requests from a limited number of
> `upper-level' DNS servers only (those that really need to transfer
> your zone). For all other clients, TCP queries are prohibited.
> Thus, there seems to be a collision between firewall rules and the
> protocol suggested by the DNS server itself.


That would not be the first time firewalls have caused trouble.

rick jones
--
Wisdom Teeth are impacted, people are affected by the effects of events.
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to raj in cup.hp.com but NOT BOTH...
 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      04-19-2005, 06:11 PM

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...

> Still, there seems to be an issue related to firewalling.
> AFAIK, a common practice of protecting DNS servers is to
> accept UDP requests from anyone but accept TCP requests
> from a limited number of `upper-level' DNS servers only
> (those that really need to transfer your zone).


DNS servers are required to support TCP client queries. This "common
practice" is as broken as using path MTU discovery and filtering all ICMP.

> For all
> other clients, TCP queries are prohibited. Thus, there
> seems to be a collision between firewall rules and the
> protocol suggested by the DNS server itself.


Not everyone who configures a firewall knows what the hell they're
doing.

DS


 
Reply With Quote
 
muxaul@lenta.ru
Guest
Posts: n/a

 
      04-20-2005, 03:24 AM
David Schwartz wrote:
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) ups.com...
> > Still, there seems to be an issue related to firewalling.
> > AFAIK, a common practice of protecting DNS servers is to
> > accept UDP requests from anyone but accept TCP requests
> > from a limited number of `upper-level' DNS servers only
> > (those that really need to transfer your zone).

>
> DNS servers are required to support TCP client queries. This "common
> practice" is as broken as using path MTU discovery and filtering all

ICMP.

Thank you for the reply, David. Still, I am afraid not everyone will
agree with you. At least, there are guys at comp.os.linux.security
who seem to share what I have called `a common practice'.

> > For all
> > other clients, TCP queries are prohibited. Thus, there
> > seems to be a collision between firewall rules and the
> > protocol suggested by the DNS server itself.

>
> Not everyone who configures a firewall knows what the hell they're
> doing.


Sure thing. ;-)


Mikhail

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excess ARP requests Bill Linux Networking 3 06-17-2008 09:07 AM
setup problem gigabit switch + 100mbit switch Glenn Windows Networking 0 09-01-2006 07:42 AM
extracting XID from RPX requests Jochen Witte Linux Networking 0 07-07-2004 10:25 AM
Requests recorded Bernd Roth Linux Networking 1 04-24-2004 09:03 PM
Stopping ARP requests James Knott Linux Networking 7 01-24-2004 10:26 PM



1 2 3 4 5 6 7 8 9 10 11