Defensive Security

DNS Security: The Protocol Everyone Allows and Nobody Watches

Of all the protocols leaving a corporate network, DNS gets the least scrutiny. It is required for everything to function, so it is allowed everywhere, and because it is infrastructure rather than content it is rarely logged in any useful way.

DNS Security: The Protocol Everyone Allows and Nobody Watches

That combination makes it the preferred channel when other routes are blocked.

Tunnelling and exfiltration

Data can be encoded into the subdomain portion of a query. The client asks for <encoded-data>.attacker.com, your resolver dutifully forwards it, and the attacker's authoritative server receives the data and replies with instructions encoded in the response.

No connection to a blocked address is ever made. From the network's perspective it is ordinary DNS traffic to your own resolver.

It is slow, which makes it poor for bulk theft and entirely adequate for credentials, keys and command-and-control. Several well-known malware families use it as a fallback when other channels fail.

What tunnelling looks like in logs

Once you are collecting resolver logs, the signals are reasonably distinctive:

  • Unusually long names. Legitimate names are short; encoded payloads are not.
  • High query volume to one domain, especially with a different subdomain each time and almost no repetition.
  • High entropy in subdomain strings — random-looking rather than word-like.
  • TXT and NULL record types at volume, which carry more data per response than A records.
  • Queries to a domain registered days ago. Newly registered domain age is a strong standalone signal.
  • Steady periodic queries from one host, which is beaconing.

Domain and registrar attacks

A different and more damaging category: taking control of the domain itself.

Registrar account compromise lets an attacker repoint your domain entirely — website and email. Protect it like production infrastructure: multi-factor authentication, registrar lock enabled, a monitored role address rather than a personal one, and a documented owner so it is not discovered to have lapsed.

Dangling records pointing at decommissioned cloud resources allow someone else to serve content on your subdomain, with all the trust your domain carries.

Cache poisoning is largely mitigated by modern resolver behaviour and DNSSEC validation, but unpatched or misconfigured resolvers remain vulnerable.

Controls worth implementing

  • Force all DNS through your own resolvers. Block outbound port 53 to anything else at the firewall. Without this, a host can simply query an external resolver and all your monitoring is bypassed.
  • Log resolver queries centrally with the source host. This is the single most valuable DNS control and it is frequently absent. Query logs are also among the most useful data in any incident investigation.
  • Filter known-malicious and newly registered domains. A protective DNS service blocks a meaningful share of commodity attacks before any connection is made.
  • Handle encrypted DNS deliberately. DNS over HTTPS from an application bypasses your resolver entirely on port 443. Decide your policy, configure browsers to use your resolver, and block known public endpoints if your policy requires it.
  • Enable DNSSEC validation on your resolvers and sign your own zones.
  • Monitor for lookalike domains registered against your brand, using certificate transparency feeds.

Where to start

If you do nothing else, log your resolver queries and force all DNS through it. Almost every DNS-based attack becomes visible once those two are in place, and neither requires new budget.

Frequently asked questions

How do I detect DNS tunnelling?
Watch for long, high-entropy subdomain labels, large query volumes to a single domain with little repetition, heavy TXT record use and queries to very recently registered domains.
Does DNS over HTTPS break monitoring?
It can, because it moves resolution to port 443 and bypasses your resolver. Decide a policy, point managed browsers at your own resolver, and block public endpoints if your policy requires it.
What is the first DNS control to implement?
Central query logging with the source host recorded, plus firewall rules forcing all DNS through your own resolvers. Most DNS attacks become visible once both are in place.

Related reading

0 comments

Leave a comment

Comments are moderated before appearing.