Guide

DNS Security Best Practices

DNS is the foundation of your internet presence — and a prime target for attackers. DNSSEC, DNS filtering, and proper DNS record management protect your domain from hijacking, spoofing, and cache poisoning. Cyber Defense Agent scans your DNS records in every assessment.

FK

Farhad Mirza Khawar

Founder of HIPAA Agent and Cyber Defense Agent. Compliance infrastructure for SMBs. Sacramento, CA.

2026-05-01

Why DNS security matters

The Domain Name System (DNS) translates human-readable domain names into IP addresses. It is one of the most critical — and most targeted — components of internet infrastructure. DNS attacks can have devastating consequences: 1. DNS hijacking — Attackers modify DNS records to redirect your domain's traffic to their servers. Visitors to your website, email, and applications are silently redirected to attacker-controlled infrastructure. They can intercept credentials, deliver malware, and impersonate your organization. 2. DNS cache poisoning — Attackers inject fraudulent DNS responses into resolver caches, causing users to be directed to malicious servers even when your DNS records are correct. 3. DNS tunneling — Attackers use DNS queries and responses to exfiltrate data from compromised networks, bypassing firewalls that do not inspect DNS traffic. 4. Domain shadowing — Attackers compromise DNS credentials and create subdomains under your domain to host phishing sites, malware, and command-and-control infrastructure. Your domain's reputation is exploited to bypass security filters. 5. Typosquatting — Attackers register domains similar to yours (missing a letter, different TLD) to intercept mistyped URLs and launch phishing attacks targeting your clients and employees. Cyber Defense Agent scans DNS records: Every CDA assessment reviews your DNS configuration, checking for proper email authentication records (SPF, DKIM, DMARC), exposed services, misconfigured records, and potential security issues. DNS findings are integrated into your Cyber Defense Score. DNS is uniquely critical because virtually every network connection starts with a DNS query. Compromise DNS, and you compromise the foundation of all network communication.

DNSSEC: authenticating DNS responses

DNSSEC (Domain Name System Security Extensions) adds cryptographic authentication to DNS responses, preventing cache poisoning and ensuring that DNS answers have not been tampered with in transit. How DNSSEC works: DNSSEC uses digital signatures to authenticate DNS data. When a DNS resolver queries a DNSSEC-signed domain, it can verify that the response: - Originated from the authoritative DNS server (not an attacker). - Has not been modified in transit. - Is the correct response for the query. DNSSEC does not encrypt DNS traffic — it authenticates it. For DNS encryption, you need DNS over HTTPS (DoH) or DNS over TLS (DoT), which are separate protections. Implementing DNSSEC for your domain: 1. Check your registrar and DNS provider support: Most major registrars (Cloudflare, GoDaddy, Namecheap, Google Domains) and DNS providers (Cloudflare, AWS Route 53, Azure DNS) support DNSSEC. 2. Enable DNSSEC at your DNS provider: Generate the DNSSEC keys (KSK and ZSK) at your DNS provider. This is typically a one-click operation in the DNS management console. 3. Add the DS record at your registrar: Copy the DS (Delegation Signer) record from your DNS provider and add it at your domain registrar. This links the chain of trust from the TLD to your domain. 4. Verify DNSSEC configuration: Use dnsviz.net or DNSSEC Analyzer (dnssec-debugger.verisignlabs.com) to verify your DNSSEC chain of trust is complete and valid. 5. Monitor for DNSSEC failures: DNSSEC validation failures can make your domain unreachable. Monitor your domain's DNSSEC status and have a rollback plan. DNSSEC considerations: - Key rotation: DNSSEC keys should be rotated periodically (ZSK quarterly, KSK annually). Most managed DNS providers handle this automatically. - Performance: DNSSEC adds minimal latency to DNS resolution (typically 1-2ms). The security benefit far outweighs the performance cost. - Compatibility: All modern DNS resolvers support DNSSEC validation. Enabling DNSSEC does not break compatibility for clients that do not validate.

DNS filtering and protective DNS

DNS filtering blocks access to known malicious domains at the DNS layer — before a connection is established. It is one of the most cost-effective security controls available. How DNS filtering works: Instead of using your ISP's default DNS resolver, you configure your devices and network to use a protective DNS service. This service checks every DNS query against threat intelligence databases and blocks queries to known malicious, phishing, and malware-hosting domains. DNS filtering solutions for SMBs: 1. Cisco Umbrella (OpenDNS) — Enterprise-grade DNS filtering with detailed reporting. Integrates with most firewalls and MDM solutions. Pricing based on user count. 2. Cloudflare Gateway — Part of Cloudflare Zero Trust. Includes DNS filtering, HTTP filtering, and browser isolation. Free tier available for up to 50 users. 3. NextDNS — Privacy-focused DNS filtering with excellent customization. Free tier for up to 300,000 queries/month. Pro plan at $1.99/month. 4. Microsoft Defender for Endpoint — Includes web content filtering and network protection that operates at the DNS layer. Included with Microsoft 365 Business Premium. What DNS filtering blocks: - Known malware command-and-control (C2) domains - Phishing domains identified by threat intelligence - Newly registered domains (commonly used for attacks) - Typosquatting domains targeting your organization - Cryptomining domains - Content categories (optional: gambling, adult content, social media) Deployment options: - Network-level: Configure your office router or firewall to use the protective DNS resolver. Protects all devices on the network. - Device-level: Install the DNS filtering agent on each device via MDM. Protects devices regardless of network (critical for remote workers). - Both: Network-level for the office, device-level for remote workers. This provides comprehensive coverage. DNS filtering is particularly valuable because it works regardless of the protocol or application being used. Unlike email or web gateway filtering, DNS filtering protects against threats from any application that makes DNS queries — including non-browser applications, APIs, and IoT devices.

DNS record management and CDA scanning

Proper DNS record management prevents misconfigurations that expose your organization to attack. Essential DNS records and security considerations: 1. A and AAAA records — Point your domain to the correct IP addresses. Audit regularly to ensure no unauthorized changes. Remove A records for decommissioned services to prevent subdomain takeover. 2. MX records — Define your mail servers. Ensure MX records point to your actual mail provider. Incorrect MX records can route email through unauthorized servers. 3. SPF record — Specifies which servers are authorized to send email for your domain. Misconfigured SPF records allow email spoofing. CDA scans verify SPF record presence and syntax. 4. DKIM records — Contain the public keys for email authentication. CDA verifies DKIM record publication and configuration. 5. DMARC record — Defines how receiving servers should handle email that fails SPF or DKIM checks. CDA checks DMARC policy (none, quarantine, reject) and reporting configuration. 6. CAA records — Certificate Authority Authorization records specify which CAs can issue certificates for your domain. Prevents unauthorized certificate issuance. 7. TXT records — Used for domain verification and configuration. Audit regularly — stale TXT records from former service providers can be exploited. 8. CNAME records — Aliases for other domains. Dangling CNAMEs (pointing to decommissioned services) are a common subdomain takeover vector. CDA DNS scanning: Every Cyber Defense Agent scan reviews your DNS configuration: - Verifies SPF, DKIM, and DMARC records are present and correctly configured. - Checks for exposed services revealed by DNS records. - Identifies potential misconfigurations in DNS record syntax. - Monitors for changes between scans that could indicate unauthorized modifications. DNS hygiene best practices: - Use a reputable DNS provider with DDoS protection (Cloudflare, AWS Route 53, Azure DNS). - Enable two-factor authentication on your DNS provider and registrar accounts. - Enable registrar lock (clientTransferProhibited) to prevent unauthorized domain transfers. - Audit DNS records quarterly. Remove records for services you no longer use. - Use separate accounts for domain registration and DNS management where possible. - Monitor Certificate Transparency logs for unauthorized certificates issued for your domain. - Document your DNS architecture: which records exist, why, and who manages them.

Key Takeaways

TL;DR

DNS is the foundation of your internet presence — compromised DNS can redirect all your traffic to attackers.

Enable DNSSEC to authenticate DNS responses and prevent cache poisoning attacks.

Deploy DNS filtering (Cloudflare Gateway, Cisco Umbrella, or NextDNS) to block malicious domains before connections are established.

Cyber Defense Agent scans your DNS records in every assessment, checking SPF, DKIM, DMARC, and exposed services.

Audit DNS records quarterly, remove stale records, and enable registrar lock and two-factor authentication on DNS accounts.

FAQ

Frequently asked questions

Does Cyber Defense Agent scan my DNS records?

Yes. Every CDA scan reviews your DNS configuration, including SPF, DKIM, and DMARC email authentication records, exposed services identified through DNS, record syntax and configuration, and changes between scans. DNS findings are integrated into your Cyber Defense Score with specific remediation guidance.

What is DNSSEC and should I enable it?

DNSSEC adds cryptographic signatures to DNS responses, ensuring they have not been tampered with. It prevents DNS cache poisoning and response spoofing. Most major DNS providers (Cloudflare, Route 53, Azure DNS) support DNSSEC with one-click enablement. Yes, you should enable it — the setup is straightforward and the security benefit is significant.

Is DNS filtering worth implementing?

DNS filtering is one of the most cost-effective security controls available. It blocks connections to known malicious domains before they are established, protecting against malware, phishing, and command-and-control traffic. Solutions like Cloudflare Gateway offer a free tier for up to 50 users. For the cost (often free or minimal) and the protection provided, DNS filtering is absolutely worth implementing.

Get your Cyber Defense Score™ in 60 seconds.

100 tools. No installation. No credit card. Real evidence.