cybervaultechGet CyberVault
← All articles
Cybersecurity basics

How Does DNS Work—and How Do DNS Spoofing and Hijacking Attacks Succeed?

Follow a DNS lookup from browser to authoritative server, then learn how spoofing, hijacking, malicious resolvers, and domain takeover alter the result.

The Domain Name System translates names such as example.com into records computers use, including IP addresses. A typical device asks a recursive resolver, which checks its cache or queries the DNS hierarchy until it reaches authoritative information. DNS attacks succeed by forging, altering, redirecting, or taking control of some part of that chain.

A normal DNS lookup

  1. An application asks the operating system for a domain.
  2. The device checks local caches and configuration.
  3. A recursive resolver checks its cache.
  4. If necessary, the resolver follows referrals from root to top-level-domain servers and then to the domain’s authoritative server.
  5. The answer is cached for its time to live and returned to the client.

DNS can return more than addresses: mail routing, aliases, service discovery, text records, name servers, and other data all use the same system.

DNS spoofing and cache poisoning

Spoofing causes a victim or resolver to accept a false answer. Cache poisoning inserts that false answer into a resolver’s cache, potentially affecting many users until expiry or correction.

Modern resolvers use transaction identifiers, source-port randomization, validation, and patched software to make blind forgery harder. DNSSEC adds signatures that allow validation of data authenticity and integrity when the chain is correctly deployed. It does not encrypt DNS queries.

DNS hijacking

Hijacking changes where queries go or changes legitimate records. Attackers may:

  • compromise a registrar or DNS hosting account;
  • change name-server or zone records;
  • alter a router’s resolver settings;
  • install malware that changes local DNS configuration;
  • operate a malicious hotspot or resolver;
  • abuse an exposed management interface;
  • take over a dangling cloud or SaaS resource referenced by DNS.

Account security and change control around registrars and DNS providers are therefore critical.

DNS rebinding

In DNS rebinding, an attacker-controlled name resolves in a way that causes a browser to interact with internal or local services. Defenses can include browser behavior, application host validation, network controls, and protections in DNS resolvers or gateways. The exact risk depends on the application and environment.

DNS tunneling

Because DNS is widely permitted, malware may encode command-and-control messages or stolen data into queries and responses. Detection looks for unusual query volume, label length, entropy, rare domains, record types, and device behavior. Legitimate security and service-discovery tools can produce unusual DNS too, so context is necessary.

DNS over HTTPS and DNS over TLS

Encrypted DNS protects queries between a client and its configured resolver from ordinary local observation or modification. It does not make the resolver trustworthy, validate all record authenticity, or conceal the destination from every network observer. DNSSEC and encrypted transport solve different problems.

Organizations also need policy: unmanaged encrypted DNS can bypass internal filtering and visibility, while forced interception can undermine privacy and protocol expectations.

Protecting domains and resolvers

  • Use strong, phishing-resistant authentication at the registrar and DNS provider.
  • Apply registry lock or equivalent protection to critical domains where available.
  • Restrict and audit record changes.
  • Separate administrative accounts and keep recovery information secure.
  • Monitor certificate issuance and DNS changes.
  • Patch recursive and authoritative servers.
  • Disable open recursion unless intentionally providing a public resolver.
  • Validate DNSSEC where appropriate and manage signing keys carefully.
  • Protect routers and endpoints from configuration changes.
  • Monitor for dangling records and abandoned third-party resources.

How HTTPS interacts with DNS attacks

Redirecting DNS does not automatically defeat HTTPS. A browser still expects a valid certificate for the requested hostname. Attackers may combine DNS control with certificate issuance, compromised endpoints, warning bypass, or services that lack proper TLS validation. Defense relies on layers rather than DNS alone.

The bottom line

DNS is both a naming system and a security dependency. Protect the accounts and infrastructure that publish records, validate answers where possible, encrypt resolver traffic where appropriate, and monitor changes. When a name points somewhere unexpected, investigate the entire chain—not only the web server.

Sources

CyberVault cybersecurity knowledge vault cover
TAKE THE KNOWLEDGE WITH YOU / CYBERVAULT

Turn a useful read into a lasting reference.

Keep building your security foundations with CyberVault: a searchable library of concepts, tool manuals, and pentesting field notes. Local Markdown files, ready for Obsidian.

  • 200 security concepts
  • 400 tool manuals
  • Pentesting field notes
One-time payment · Open locally in Obsidian · Add your own notes
KEEP FOLLOWING THE THREAD

More from the notebook.

All articles ↗
Cybersecurity basics

Antivirus vs EDR: What Is the Difference, and Does a Small Business Need Both?

Antivirus focuses on preventing and detecting malicious files and behavior; EDR adds endpoint telemetry, investigation, and response. Learn where each fits.

Read article
Cybersecurity basics

Can You Learn Cybersecurity Without Coding? What You Actually Need to Know

You can begin cybersecurity without programming. Learn which roles need code, which fundamentals matter first, and how to build practical automation skills gradually.

Read article
Cybersecurity basics

Does a VPN Protect You From Hackers? What It Stops—and What It Cannot

A VPN protects traffic on part of its journey, but it cannot stop phishing, malware, unsafe accounts, or a compromised device. Learn where it helps.

Read article