I'm using Mac OS, Snow Leopard 10.6.2, and I'm suffering from UDP packet loss during DNS query. So my web browser is too slow to surf internet nicely. But it worked very well when I tried a DNS query on TCP using dig command.

However, I can't find some control switch to change to use TCP during DNS query. Is there a way to change it in Mac OS?

Thank you.

migrated from serverfault.com May 19 '10 at 15:31

This question came from our site for system and network administrators.


There's no way (that I know of) to force the standard resolver library (see man 3 res_query) to use TCP for all connections, although individual applications can do it my setting the RES_USEVC flag when they start up.

Nor is there any way to configure BIND to only send queries over TCP.

I believe you might do it in theory by running Unbound locally and setting the "do-udp" flag to false, and then putting in your DNS config in the Network control panel.

However the documentation is not clear whether that then prevents Unbound from answering queries received over UDP. I'll test that... No, it didn't work. I've e-mailed the author...

That said, you really shouldn't do this - you should find the real fault. I'm a strong believer in requiring TCP support in DNS (I wrote draft-ietf-dnsext-dns-tcp-requirements-03), but it's still only supposed to be used as a fallback when UDP messages are too big to fit either in 512 bytes or an extended EDNS0 compatible format.

  • 1
    yah, find the cause for loss of packets. do not push that problem aside by saying "well, tcp will take care of that for me, just keep sending packets until the request is complete". – akira May 19 '10 at 16:16

Your Answer

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