Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.


share|improve this question
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:

share|improve this answer
Maybe we should found someone to modify glibc 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.

share|improve this answer

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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