Book a Security Consultation

What Is DNS Security?

7 minute read
Intermediate

DNS security protects against DNS hijacking, tunneling, and malware communication.

The DNS Attack Surface

DNS is a critical attack surface because it is almost universally permitted through firewalls — blocking DNS would prevent internet connectivity entirely. This universal permission makes DNS an attractive channel for attackers who need to communicate with compromised systems (C2 via DNS tunneling), exfiltrate data (encoding data in DNS queries), or redirect victims to malicious infrastructure (DNS spoofing and cache poisoning).

DNS Tunneling

DNS tunneling encodes data within DNS query and response records, using the DNS protocol as a data channel that bypasses network security controls that block or monitor other protocols. Malware using DNS tunneling for command and control communications appears to generate legitimate DNS traffic to monitoring tools that do not perform deep DNS inspection. Tools like iodine and DNScat implement DNS tunneling for both legitimate and malicious purposes.

DNS Hijacking

DNS hijacking modifies DNS records to redirect users from legitimate destinations to attacker-controlled infrastructure. BGP hijacking redirects internet routing to attacker-controlled systems. DNS cache poisoning injects malicious DNS responses into resolver caches, causing clients querying those resolvers to receive incorrect IP addresses. DNSSEC — DNS Security Extensions — provides cryptographic authentication of DNS records, preventing cache poisoning attacks.

Protective DNS

Protective DNS services — Cisco Umbrella, Cloudflare Gateway, Quad9 — filter DNS resolution requests against threat intelligence databases, blocking access to known malicious domains at the DNS layer. When a user's device attempts to resolve a known C2 domain, protective DNS returns a blocked response rather than the attacker's IP address, preventing the connection before it reaches the network. DNS filtering is one of the most cost-effective security controls available because it provides broad coverage for a wide range of threats at minimal operational complexity.

DNS Security Monitoring

DNS logging captures every domain resolution attempted across the environment, providing a forensic record of what external resources systems were attempting to reach. DNS anomaly detection identifies patterns associated with malicious activity: high-frequency resolution of newly registered domains, resolution of domains with high entropy names (characteristic of domain generation algorithms), DNS query volumes inconsistent with normal operation, and resolution of domains appearing on threat intelligence blocklists. For many organizations, DNS logs are the most underutilized security data source available.

Related Reading

Frequently Asked Questions

What is DNS tunneling?

DNS tunneling encodes data within DNS query and response records, using the DNS protocol as a data channel that bypasses network security controls that block or monitor other protocols. Malware using DNS tunneling for command and control communications appears to generate legitimate DNS traffic to monitoring tools that do not perform deep DNS inspection. Tools like iodine, DNScat, and dnscat2 implement DNS tunneling. The technique is particularly effective because DNS is almost universally permitted through firewalls — blocking DNS would prevent internet connectivity entirely.

What is DNS hijacking?

DNS hijacking modifies DNS records to redirect users from legitimate destinations to attacker-controlled infrastructure. The attack can occur at multiple layers: compromising DNS servers to modify records directly, exploiting registrar accounts to change authoritative DNS settings, conducting cache poisoning attacks that inject malicious responses into resolver caches, or compromising endpoints to modify local DNS settings. DNS hijacking enables phishing campaigns where users visiting legitimate-looking URLs are silently redirected to attacker-controlled sites.

What are the leading protective DNS providers?

Cisco Umbrella (formerly OpenDNS), Cloudflare Gateway, and Quad9 are the leading protective DNS providers. Microsoft Defender for Endpoint includes DNS filtering as part of its broader endpoint protection. SafeDNS and DNSFilter serve mid-market and SMB markets. Protective DNS services filter DNS resolution against threat intelligence databases, blocking access to known malicious domains at the DNS layer before connections are established. DNS filtering provides broad coverage for a wide range of threats at minimal operational complexity — one of the highest-ROI security controls available.

What is DNSSEC?

DNS Security Extensions provide cryptographic authentication of DNS records, preventing cache poisoning attacks where attackers inject malicious DNS responses into resolver caches. DNSSEC works by signing DNS records with cryptographic keys; resolvers verify the signatures to confirm that responses came from legitimate authoritative servers and were not modified in transit. DNSSEC adoption remains incomplete — most consumer DNS resolvers do not validate DNSSEC signatures, and many domains are not signed. Where deployed correctly, DNSSEC eliminates an entire category of DNS-based attacks.

Why is DNS monitoring valuable?

DNS logs capture every domain resolution attempted across the environment, providing a forensic record of what external resources systems were attempting to reach. For investigation purposes, DNS logs answer the question of what systems tried to communicate with attacker infrastructure before connections were blocked or detected. DNS anomaly detection identifies patterns associated with malicious activity: high-frequency resolution of newly registered domains, resolution of high-entropy domain names characteristic of domain generation algorithms, and DNS query volumes inconsistent with normal operation. DNS logs are the most underutilized security data source in most environments.

What is BGP hijacking?

Border Gateway Protocol (BGP) hijacking redirects internet routing to attacker-controlled systems by announcing fraudulent BGP routes that other internet routers accept and propagate. Unlike DNS hijacking which modifies name-to-IP translation, BGP hijacking modifies the routing path that traffic takes to reach an IP address. BGP hijacking enables traffic interception at internet scale and has been used in nation-state attacks against financial institutions, cryptocurrency exchanges, and government targets. RPKI (Resource Public Key Infrastructure) is the cryptographic standard that authenticates BGP route announcements and prevents fraudulent route propagation.

Can DNS security stop ransomware?

Protective DNS stops a significant percentage of ransomware infections at multiple stages. When ransomware payloads download from known malicious infrastructure, protective DNS blocks the download. When ransomware attempts to communicate with command and control servers, protective DNS blocks the C2 connection — preventing the ransomware from receiving activation keys, encryption configurations, or exfiltration instructions. Ransomware that cannot reach its C2 cannot complete its attack chain. DNS security is not sufficient alone but is one of the most effective single controls against ransomware delivery and detonation.

Real-World Example: Protective DNS Blocks Ransomware C2 Communication

A Cloudskope MDR client's network attempted DNS resolution of a known REvil ransomware C2 domain following what appeared to be a phishing link click on an employee workstation. Protective DNS returned a blocked response, preventing the ransomware payload from receiving its activation key and encryption configuration from the C2 server. The ransomware had been downloaded but could not complete its attack without C2 communication. The incident was contained within four minutes of the initial DNS block alert, before encryption occurred.

91%

Of malware uses DNS to communicate — either for C2 communications, data exfiltration, or to locate attacker infrastructure. Protective DNS monitoring provides coverage against the majority of malware communication regardless of the specific malware family.

How Cloudskope Can Help

Cloudskope's network security assessments evaluate DNS security configuration, protective DNS deployment, and DNS monitoring coverage. Our MDR service includes DNS anomaly detection as a core component of threat hunting and C2 detection capability.