Some thoughts on DNS over TCP

The majority of DNS queries out there use UDP for the query. TCP is only needed in the following cases:

The first case can be minimized on an authoritative-only DNS server by looking for queries that result in oversized packets. Such queries can almost always be reduced to 512 bytes or less by:

The only time a DNS server needs to be accessible to anyone any everyone on the internet is when it is functioning as an authoritative server. If the DNS server is a caching name server, or providing zone transfers to slaves, IP-based access restriction can, and should, be performed.

Since it is possible to make all records returned as an authoritative DNS server fit in 512 bytes or less (see above), access restrictions can be placed on all connections on TCP port 53 of a DNS server.

When an unauthorized client connects to port 53 of a DNS server, we can do any of the following five actions, depending on the level of security we desire: