DNS spoofing, also called DNS cache poisoning, is an attack that inserts false DNS records into a resolver's cache so a domain name resolves to an attacker-controlled IP address. You type the correct address, but your browser opens a fake site that can steal passwords, serve malware, or intercept traffic.
Key takeaways
- DNS spoofing corrupts a resolver's cache, so one poisoned entry can redirect many users to a fake site.
- The attack works because classic DNS over UDP has no built-in way to verify that a reply is genuine.
- DNSSEC, encrypted DNS, patched resolvers, and locked-down registrar accounts are the main defenses.
You type your bank's address correctly, press Enter, and the page looks almost right. That is the danger of DNS spoofing: the name in your address bar can be correct while the site behind it is not.
What is DNS spoofing?
DNS spoofing is an attack that corrupts Domain Name System (DNS) data so a domain name resolves to the wrong IP address. Instead of reaching the real website, your browser is sent to a server controlled by the attacker.
DNS is the internet's address book. It translates human-readable names such as example.com into IP addresses that computers use to connect. When that translation is wrong, everything built on it goes to the wrong place.
DNS spoofing is also called DNS cache poisoning, because the most common method plants false records in a DNS resolver's cache. Cloudflare's guide describes it as entering false information into a DNS cache so queries return an incorrect response. Once poisoned, the resolver hands out the false answer to every user who asks for that domain until the entry expires or is cleared.
The attack does not need to break into the real website. The real site stays untouched. Only the directions to it are changed, which is why victims often have no idea anything is wrong.
How does DNS normally work?
When you visit a site, your device asks a DNS resolver for the IP address of the domain. The resolver checks its cache, asks other servers if needed, returns the address, and your browser connects to it.
Resolvers cache answers to work faster. Each record has a time to live (TTL), which says how long the answer can be reused before the resolver must ask again. Caching is normal and useful, but it also creates the opening for poisoning.
Most DNS queries traditionally use UDP, a lightweight protocol with no handshake. That speed comes at a cost: a resolver cannot easily tell whether a reply really came from the authoritative server it asked.
Your device usually uses a resolver supplied by your internet provider, your employer, or a public service. If that resolver is poisoned, everyone using it can be affected at once.
How does DNS spoofing work?
An attacker races the real answer. The resolver asks an authoritative server for an address, and the attacker floods it with forged replies that claim to be from that server but contain the attacker's IP address.
If a forged reply arrives first and matches the details the resolver expects, such as the transaction ID, the resolver accepts it and caches it. From then on, users of that resolver are sent to the fake site.
The classic weakness was a 16-bit transaction ID, which has only 65,536 possible values. An attacker sending many forged replies had a realistic chance of guessing correctly before the genuine answer arrived.
In 2008, researcher Dan Kaminsky showed the attack was far more practical than many believed. By asking for random, non-existent subdomains, an attacker could force fresh queries again and again, giving many more chances to poison the cache. Vendors responded with source port randomization and other hardening.
What are the main types of DNS spoofing?
The main types are cache poisoning, on-path response forgery, local DNS tampering, and router or resolver compromise. They differ in where the false answer is planted, but the result is the same: a wrong destination.
Cache poisoning
This is the classic form. False records are injected into a recursive resolver's cache, as described above. It can affect many users and lasts until the TTL expires or the cache is flushed.
On-path forgery
An attacker on the same network, such as public Wi-Fi, intercepts DNS queries and replies with forged answers before the real resolver responds. This is why untrusted Wi-Fi is a common setting for DNS attacks.
Local DNS tampering
Malware or a compromised router changes the DNS settings on a device or home router. The device then uses an attacker-controlled resolver for every lookup, even on trusted networks.
DNS hijacking
Hijacking is a related but different attack. Instead of poisoning a cache, the attacker changes the authoritative DNS records themselves, often by taking over a registrar or DNS provider account. CISA issued Emergency Directive 19-01 in January 2019 after a campaign that used stolen DNS credentials to change records and obtain valid certificates.
DNS spoofing vs pharming vs DNS hijacking
These terms overlap and are often mixed up. Spoofing is the forged answer, pharming is the scam that uses it, and hijacking is the takeover of the real DNS settings.
| Attack | What changes | Who is affected | Main defense |
|---|---|---|---|
| DNS spoofing / cache poisoning | False record in a resolver cache | Users of that resolver | DNSSEC validation, patched resolvers |
| Pharming | Victims redirected to a fake site | Anyone who visits the spoofed domain | DNSSEC, HTTPS checks, trusted DNS |
| DNS hijacking | Authoritative records at the registrar or provider | Everyone worldwide who looks up the domain | Phishing-resistant MFA, registrar lock |
| Local DNS tampering | DNS settings on a device or router | That device or household | Updated firmware, malware removal |
Pharming deserves a note because it is the scam, not the technique. An attacker poisons DNS, then builds a copy of a bank or login page to harvest credentials. The victim did nothing wrong except type the right address.
What do attackers gain from DNS spoofing?
Attackers gain a trusted-looking front door. A fake banking, email, or shopping page can harvest passwords, payment details, and one-time codes, or install malware on visitors.
Because the domain looks correct, victims are more likely to log in than they would be after clicking a suspicious link. That trust is the whole point of the attack.
Spoofed DNS can also be used to intercept email by redirecting mail records, to block security updates by sending update checks to a dead server, or to support censorship by redirecting blocked sites to a warning page.
For a business, a poisoned resolver can send staff to a fake internal login page or a fake supplier portal. One successful harvest can then lead to account takeover, invoice fraud, or a wider breach.
How can you tell if DNS has been spoofed?
There is often no obvious sign, which is why prevention matters more than detection. Still, several clues should make you stop and check before you log in.
- Certificate warnings. Your browser says the certificate is invalid, expired, or for a different name. Never click past this warning.
- A familiar site looks slightly wrong. Logos, wording, or layout are off, or the site asks for details it never asked for before.
- Logins fail repeatedly, or you are asked to re-enter a password and a one-time code more than once.
- You land on a different site after typing a known address, or the page redirects unexpectedly.
- Security updates fail or antivirus updates stop working without explanation.
- Other people on the same network see the same problem, which points to a shared resolver or router rather than one device.
If you suspect spoofing, try the same site from mobile data instead of Wi-Fi, or from another device. If it works normally there, the first network or device is the likely problem. You can also check a domain's records with our free DNS lookup tool and compare them with a trusted source.
Are there real DNS spoofing cases?
Yes. The best-known is the Kaminsky vulnerability disclosed in 2008, which showed that cache poisoning was practical against many resolvers at the time and forced a coordinated patching effort across vendors.
In January 2019, CISA issued Emergency Directive 19-01 after attackers used stolen credentials to tamper with DNS records for US federal agencies and other organizations. The directive ordered agencies to audit DNS records, change passwords, add multi-factor authentication, and monitor certificate transparency logs.
DNS spoofing has also been used for censorship. Cloudflare notes that several governments have intentionally poisoned DNS caches inside their countries to deny access to certain websites. The technique is the same; only the motive differs.
Smaller cases happen quietly. Home routers with weak passwords or old firmware have been changed to point at attacker-controlled resolvers, sending whole households to fake pages. That is why router security is part of DNS defense.
How do you prevent DNS spoofing?
No single setting stops every form of DNS spoofing. The strongest approach layers DNSSEC, encrypted DNS, patched software, and locked-down accounts that control DNS.
For individuals
Use a trusted DNS resolver. Stick to your provider's resolver or a well-known public resolver, and be careful about changing DNS settings on public Wi-Fi. A VPN on untrusted networks also helps.
Keep your router updated. Install firmware updates, change the default admin password, and turn off remote management unless you need it. Our guide to how to secure your Wi-Fi covers the router settings that matter most.
Take certificate warnings seriously. If your browser warns about a certificate, stop. Check the address, try another network, and contact the site through a known channel before you log in.
For domain owners
Sign your zone with DNSSEC. DNSSEC uses public-key cryptography to sign DNS records, so a validating resolver can reject a forged answer. It does not encrypt DNS, but it does prove the answer is genuine.
Lock down registrar and DNS provider accounts. Use phishing-resistant multi-factor authentication, a unique password, and a registrar lock. These accounts can change where your whole domain points.
Monitor your records. Watch for unexpected changes to A, MX, and NS records, and monitor certificate transparency logs for certificates issued for your domain. You can check your current DNS and certificate setup with the free SSL checker.
What should you do if you think DNS has been spoofed?
Stop logging in, switch networks if you can, and check the site from a trusted connection. Then clear caches, check your router, and change any password you may have entered on the fake site.
- Do not enter passwords or payment details on the suspicious page, and do not click past a certificate warning.
- Switch to mobile data or another trusted network and try the site again to see if the problem follows the network.
- Flush your DNS cache and restart your device and router, then check the router's DNS settings for unknown servers.
- Change passwords for any account you may have used on the fake site, starting with email, and turn on phishing-resistant MFA.
- Report it to your internet provider or IT team, and to the real site owner so they can warn other users.
For a fuller view of how DNS attacks fit into wider account-takeover scams, see our guide to what phishing is and how fake sites are used to harvest credentials.
The bottom line
DNS spoofing works because DNS was built on trust, not verification. A single forged answer in a resolver cache can send many people to a fake site that looks exactly like the real one.
DNSSEC, encrypted DNS, patched resolvers, and locked-down DNS accounts close most of that gap. Check your own domain's DNS and certificate setup with the free DNS lookup tool and fix any weak spots before an attacker finds them.
Frequently asked questions
What is DNS spoofing in simple terms?
DNS spoofing is when an attacker changes the internet address book entry for a website. You type the right domain name, but DNS sends you to the attacker's copy of the site instead of the real one.
Is DNS spoofing the same as DNS cache poisoning?
Yes, the terms are used for the same attack in most guides. Cache poisoning is the method: false records are planted in a resolver's cache. DNS spoofing is the wider result: DNS answers are forged or tampered with.
Can DNS spoofing happen if I type the address correctly?
Yes. That is what makes it dangerous. The address in your browser can look correct while the IP address behind it is wrong, so the page you see is the attacker's fake version.
Does HTTPS protect against DNS spoofing?
Partly. HTTPS checks the site's certificate, so a fake site should trigger a browser warning if it cannot present a valid certificate for the real domain. Never click past a certificate warning, because that warning may be the only sign of spoofing.
How do I know if my DNS has been spoofed?
Warning signs include certificate errors, a familiar site that looks slightly wrong, logins that fail or ask for extra details, and being sent to a different site after typing a known address. Checking the site from another network or device can help confirm it.
What is DNSSEC and does it stop DNS spoofing?
DNSSEC adds digital signatures to DNS records so a validating resolver can check that an answer is genuine and has not been changed. It is the main technical defense against cache poisoning, although it only helps when both the domain and the resolver support it.
How can I protect myself from DNS spoofing?
Use a trusted resolver, keep your router firmware updated, use DNS over HTTPS or DNS over TLS where available, enable DNSSEC validation, and use a VPN on public Wi-Fi. For a domain you own, sign it with DNSSEC and lock the registrar account.
Is DNS spoofing the same as DNS hijacking?
No. Spoofing usually means forged answers planted in a resolver cache. Hijacking usually means an attacker changes the real DNS settings, for example by taking over a registrar or DNS provider account, so the authoritative records themselves point to the attacker.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against Cloudflare's DNS cache poisoning guide, the Canadian Centre for Cyber Security DNS tampering guidance, and DNSSEC and Kaminsky vulnerability records.
How we write and fact-check →