Need email infrastructure? Try PostScale -- transactional email API built in the EU. PostScale

    DNS Hijacking - How Domains Get Taken Over and How to Prevent It

    Learn how DNS hijacking works at the registrar, nameserver, account, and resolver layers, plus the controls that prevent domain takeover.

    Updated

    TL;DR

    DNS hijacking is unauthorized control over where a domain resolves. The attacker usually does not need to compromise your web server; they change registrar delegation, nameserver data, DNS-provider account settings, or resolver answers. The highest-leverage controls are registrar lock, MFA on registrar and DNS-provider accounts, least-privilege API keys, DNSSEC, CAA records, monitoring for NS/DS/MX changes, and an incident runbook that can restore delegation quickly.

    What you'll learn

    • Understand the main DNS hijacking paths
    • Harden registrar, DNS-provider, and API access
    • Use DNSSEC and monitoring to reduce impact
    • Prepare a recovery runbook for unauthorized delegation changes

    DNS hijacking is what happens when an attacker gains unauthorized control over where your domain resolves. They may never touch your application servers. If they can change your nameservers, records, or resolver path, they can redirect web traffic, intercept email, break certificate issuance, or make your domain disappear.

    This guide focuses on authoritative DNS and domain-management risk: the controls that stop hijacking, the monitoring that detects it, and the runbook that gets you back in control.

    Where DNS Hijacking Happens

    LayerAttackImpact
    RegistrarAttacker changes NS records or transfers the domainFull domain takeover
    Registry/DSAttacker removes or changes DS recordsDNSSEC validation gap or outage
    DNS providerAttacker changes zone recordsWeb/email/API redirection
    API/IaCLeaked token applies malicious DNS changesFast automated takeover
    Resolver/networkUser receives forged answersLocal or ISP-scale redirection

    The registrar layer is the most dangerous because it controls delegation. If the registrar points your domain at attacker-controlled nameservers, your DNS provider can still serve the correct zone and users will not query it.

    Common Hijacking Paths

    Registrar Account Compromise

    The attacker logs in to the registrar and changes nameservers, disables DNSSEC, or transfers the domain. This is often caused by reused passwords, weak MFA, mailbox compromise, or social engineering.

    Controls:

    • Hardware security key MFA
    • Registrar lock or registry lock
    • Separate registrar admin accounts from daily email accounts
    • Out-of-band approval for NS, DS, and transfer changes
    • Monitoring of parent-zone NS and DS records

    DNS Provider Account Compromise

    The attacker changes records inside the authoritative zone: A, AAAA, CNAME, MX, TXT, or CAA.

    Controls:

    • MFA for all DNS users
    • Role-based access by zone
    • Zone-scoped API keys
    • Audit logs and change alerts
    • Separate production and test zones

    Leaked Automation Credentials

    Infrastructure-as-code and CI/CD pipelines often have DNS API tokens. A leaked token can change records faster than a human attacker.

    Controls:

    • Zone-scoped tokens
    • Short-lived credentials where possible
    • CI secret scanning
    • Separate read-only and write tokens
    • Approval gates for production DNS changes

    Resolver or Network Manipulation

    Attackers can try to alter answers between users and resolvers, especially on hostile networks. DNSSEC validation is the primary defense here.

    Controls:

    • DNSSEC
    • Valid DS records at the registrar
    • Monitoring for validation failures
    • HTTPS/HSTS at the application layer

    Hardening Checklist

    • Enable registrar lock or registry lock.
    • Require phishing-resistant MFA on registrar and DNS-provider accounts.
    • Limit DNS-provider users to the zones they need.
    • Use zone-scoped API keys for automation.
    • Enable DNSSEC and keep DS records correct.
    • Publish CAA records to constrain certificate issuance.
    • Monitor NS, DS, SOA, MX, CAA, A, and AAAA answers externally.
    • Alert on DS removal and NS changes at the parent zone.
    • Keep a documented recovery contact at the registrar.
    • Test your recovery runbook before an incident.

    Detection Queries

    Check parent delegation:

    dig NS example.com +trace
    dig DS example.com +trace

    Check authoritative data:

    dig @ns1.dnscale.eu example.com SOA
    dig @ns1.dnscale.eu www.example.com A
    dig @ns1.dnscale.eu example.com MX

    Compare public resolvers:

    dig @1.1.1.1 www.example.com A +short
    dig @8.8.8.8 www.example.com A +short
    dig @9.9.9.9 www.example.com A +short

    If the parent zone points at unexpected nameservers, treat it as a registrar/delegation incident. If parent delegation is correct but authoritative answers changed, treat it as a DNS-provider or automation incident.

    Incident Response Runbook

    1. Confirm the current parent NS and DS records.
    2. Freeze domain changes at the registrar.
    3. Restore correct nameservers and DS records.
    4. Revoke suspicious registrar sessions and rotate credentials.
    5. Revoke DNS-provider API tokens and user sessions.
    6. Restore the expected zone from version control or backup.
    7. Check MX and TXT records for email interception.
    8. Check CAA records and certificate transparency logs.
    9. Preserve audit logs before cleanup.
    10. Publish customer guidance if traffic or email was exposed.

    Frequently asked questions

    Is DNS hijacking the same as cache poisoning?
    No. DNS hijacking is broader: unauthorized control over DNS resolution at the registrar, provider, account, or resolver layer. Cache poisoning is one technical method that corrupts recursive resolver answers. Registrar compromise and provider-account compromise are more common hijacking paths for managed domains.
    What is the most important DNS hijacking control?
    Registrar lock plus strong registrar account security. If an attacker can change your NS records at the registrar, they can move the whole domain away from your authoritative DNS provider. Use registrar lock, hardware-key MFA, restricted account access, and out-of-band approval for delegation changes.
    Does DNSSEC prevent DNS hijacking?
    DNSSEC prevents forged DNS answers when the chain of trust remains intact. It does not stop an attacker who controls your registrar account from changing NS and DS records. DNSSEC is necessary, but it must be paired with registrar controls and monitoring.
    How do I detect DNS hijacking quickly?
    Monitor NS, DS, SOA, MX, A/AAAA, and CAA records from multiple external resolvers. Alert on registrar delegation changes, DS removal, unexpected MX changes, and authoritative answers that differ from your expected zone state.
    What should I do first during a hijack?
    Freeze changes at the registrar, restore the correct NS and DS records, rotate compromised credentials/API keys, lower TTLs only after control is restored if needed, and notify affected customers or users based on impact. Preserve logs before making broad cleanup changes.

    Ready to manage your DNS with confidence?

    DNScale provides anycast DNS hosting with a global network, real-time analytics, and an easy-to-use API.

    Start free