惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
G
Google Developers Blog
D
Docker
阮一峰的网络日志
阮一峰的网络日志
A
About on SuperTechFans
aimingoo的专栏
aimingoo的专栏
博客园 - 聂微东
Hugging Face - Blog
Hugging Face - Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
T
The Blog of Author Tim Ferriss
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
I
InfoQ
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
Google DeepMind News
Google DeepMind News

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
DNS security in 2026: 10 things developers get wrong
Ayi NEDJIMI · 2026-05-22 · via DEV Community

I audit networks for a living. DNS configuration errors are in every single engagement — not occasionally, not mostly, but in every single one. The mistakes aren't exotic. They're the same 10 problems, over and over, across startups and mid-sized companies alike.

Developers own DNS more than they realize. You set up the subdomain for your staging environment, you configure SPF when the marketing team complains about email deliverability, you manage the certificate workflow. You are doing DNS work. Most of it is probably misconfigured.

Here's what I keep finding, and how to check yourself.

1. No DNSSEC

DNSSEC signs your DNS records so resolvers can verify they haven't been tampered with. Without it, a cache poisoning attack can redirect your users to an attacker-controlled server and there's nothing in the DNS layer to detect it.

# Check if DNSSEC is enabled for a domain
dig +dnssec example.com A

# Look for the AD flag in the response header — "ad" means authenticated data
# Also check the RRSIG records in the answer section
dig @8.8.8.8 example.com DNSKEY +short

Enter fullscreen mode Exit fullscreen mode

If you get no RRSIG records, DNSSEC isn't configured. Most registrars support it now. It takes 30 minutes to set up and you do it once.

2. SPF with +all (or no SPF at all)

SPF records specify which servers are allowed to send email for your domain. +all means "and also anyone else" — which defeats the entire purpose.

# Check your SPF record
dig TXT yourdomain.com | grep spf

# Red flags:
# v=spf1 +all              ← allows everyone
# v=spf1 include:sendgrid.net +all  ← same problem
# (no result)              ← no SPF at all

Enter fullscreen mode Exit fullscreen mode

The correct terminator is -all (fail) or ~all (softfail, useful during migration). +all is worse than no SPF because it creates a false sense of protection.

3. SPF with too many DNS lookups

SPF has a hard limit of 10 DNS lookups during evaluation. Each include: costs one lookup, and some includes contain nested includes. Exceed 10 and the record is considered invalid — meaning SPF fails for your legitimate emails.

# Count your lookups manually or use an online SPF checker
# Each "include:", "a:", "mx:", "ptr:", "exists:" costs one lookup
dig TXT yourdomain.com | grep spf
# Then recursively check each include's lookups

Enter fullscreen mode Exit fullscreen mode

The fix is to flatten your SPF record — enumerate the IP ranges directly instead of chaining includes. It's tedious but necessary if you use multiple email services.

4. DMARC is missing or set to p=none

DMARC ties SPF and DKIM together and tells receiving mail servers what to do when checks fail. Without it, your SPF and DKIM records are advisory at best.

p=none is the monitoring policy — it collects reports but takes no action. It's appropriate for initial deployment, not for production. If your DMARC is still p=none a year after you set it up, you set it and forgot it.

Target is p=reject. Most organizations that haven't thought about it are at p=none or have no DMARC at all.

5. No CAA records

CAA (Certification Authority Authorization) records specify which certificate authorities are allowed to issue certificates for your domain. Without them, any CA can issue a certificate — and there have been several cases of CAs issuing fraudulent certificates for domains they shouldn't have.

dig CAA yourdomain.com
# If empty, any CA can issue certs for your domain
# Correct example: yourdomain.com. CAA 0 issue "letsencrypt.org"

Enter fullscreen mode Exit fullscreen mode

If you use Let's Encrypt exclusively, your CAA record should say so. This is a five-minute fix with real security impact.

6. Wildcard certificates without CAA constraints

Related to the above: if you use wildcard certificates (*.yourdomain.com), you're implicitly trusting the CA's validation process for every possible subdomain. A CAA record with the issuewild tag limits which CAs can issue wildcards specifically.

# Specific CAA tag for wildcard issuance
# yourdomain.com. CAA 0 issuewild "letsencrypt.org"

Enter fullscreen mode Exit fullscreen mode

7. No MTA-STS

MTA-STS (Mail Transfer Agent Strict Transport Security) tells other mail servers that they must use TLS when sending email to your domain — and that they should fail delivery rather than fall back to plaintext.

Without it, an attacker who can intercept SMTP traffic can strip TLS and read your email in transit. It's 2026. This is not an acceptable risk for a domain that handles business email.

MTA-STS requires a policy file at https://mta-sts.yourdomain.com/.well-known/mta-sts.txt and a DNS TXT record. It's not complicated but it has moving parts, which is probably why adoption is still low.

8. Subdomain takeover risk

This one is embarrassing when it happens. You spin up a staging environment on staging.yourdomain.com, point it at an AWS S3 bucket or a Heroku dyno, then shut down the project. You delete the resource but forget to remove the DNS record. Now staging.yourdomain.com points at an unclaimed resource that anyone can claim.

The attacker creates an S3 bucket with the same name, or a Heroku app with the same app name, and suddenly staging.yourdomain.com serves their content — under your domain, with your implicit trust.

# Check for dangling CNAME records
dig CNAME staging.yourdomain.com
# If you get a CNAME to a cloud provider resource that no longer exists,
# you're vulnerable

Enter fullscreen mode Exit fullscreen mode

Audit your DNS records quarterly and remove anything that no longer corresponds to an active resource.

9. Missing PTR records

PTR records are the reverse DNS lookup — they map an IP address back to a hostname. Mail servers use them to verify that your sending IP has a PTR record matching your A record (forward-confirmed reverse DNS, or FCrDNS). Without them, your email is more likely to be marked as spam.

This is especially common with self-hosted mail or newly allocated IP ranges. Your hosting provider usually handles PTR records, but you have to request them — they're not set automatically.

10. No monitoring

You can get everything above right today and have it broken in six months when someone edits the wrong record, a third-party integration changes their IP range, or your registrar auto-renews with different defaults.

DNS monitoring doesn't have to be expensive. A cron job that runs dig checks daily and alerts on unexpected changes covers most cases. Commercial options add history and change attribution if you need them.


If you want a complete checklist of DNS security controls with implementation notes, I've put together a detailed DNS security checklist for 2026 that covers all of the above plus DANE, negative TTL configuration, resolver security, and monitoring setup. It's free, available as PDF and Excel.

The broader security checklists library also covers firewall configurations, Active Directory hardening, Windows and Linux system hardening, and more — 17 checklists total.

None of these DNS problems are hard to fix. The hard part is knowing they're broken. Most organizations I audit had no idea their SPF had a +all or that three of their CNAME records were pointing at deleted resources. A one-time audit of your DNS configuration probably takes two hours and finds at least three of the items on this list.


I run AYI NEDJIMI Consultants, a cybersecurity consulting firm. We publish free security hardening checklists for FortiGate, Palo Alto, pfSense, Sophos, Active Directory and more — PDF and Excel.