I've been doing some reading about this, according to what I understood this is possible, but HOW??,

I know UDP is much much better for DNS resolution but because of so many issues an restrictions, I need to use TCP instead, is this really possible and how can I do it?

I'm running Centos 5.5 and all I want is that ANY DNS query uses TCP instead of udp.


  • What restrictions are you trying to bypass? Many firewalls still only allow UDP DNS requests (port 53)... – voretaq7 May 21 '11 at 20:40
  • I know to modify DnsApi.dll to enable TCP only dns resolving. Does anyone know the solution for linux? – diyism Sep 15 '12 at 16:03

As far as I can tell this is not possible. In OpenBSD you could add options tcp to /etc/resolv.conf to get what you want, at least presumably, but that option doesn't exist in Linux.

You can't configure BIND to do this either. See this thread where Paul Vixie himself implies that this would be a really bad idea anyway: http://groups.google.com/group/comp.protocols.dns.bind/browse_thread/thread/2272f6c39dcfe364

  • Maybe we should found someone to modify glibc libresolv.so file just like OpenBSD – diyism Mar 13 '13 at 3:40

You are most likely using the BIND name server, which operates on TCP and UDP by default. All you need to do is allow traffic on TCP port 53 to reach your server.


DNS use UDP for resolving query and TCP for zone transfer, UDP data limit is 512 bytes and above will automatically uses TCP.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.