DNS Poisoning: What It Is and How to Prevent It

DNS Poisoning: What It Is and How to Prevent It

You type the address of your bank, the page looks right, you sign in. But it wasn't your bank. Your device asked where the site lives and somebody slipped in a false answer.

That is DNS poisoning: putting wrong records into the system that turns domain names into addresses, so that people end up somewhere else without noticing.

A one-minute refresher on DNS

Computers find each other by number, such as 203.0.113.10. People remember names. The Domain Name System (DNS) translates one into the other.

  1. Your device asks a resolver, usually run by your internet provider or by a service such as Google or Cloudflare.
  2. If the resolver doesn't know the answer, it asks the authoritative server for that domain.
  3. It sends you the address and keeps a copy for a while, so it doesn't have to ask again. That time is called TTL.

That copy is the weak point. If a false answer gets into the resolver's memory, everybody who uses it receives the false answer until it expires. If you want the full picture, read how DNS works.

How poisoning happens

Classic DNS messages are not encrypted or signed. The resolver accepts an answer if it arrives from the expected place with the right identification number. Attackers take advantage of that in several ways.

MethodWhat the attacker does
Forged answersSends many false replies, hoping one matches before the real one arrives
In-the-middleSits on the same network, for example public Wi-Fi, and changes the replies
Router takeoverEnters a home or office router with a weak password and changes its DNS servers
MalwareEdits the hosts file or the DNS settings of a computer or phone
Account takeoverSteals the password of the registrar or DNS provider and edits the real records

Strictly speaking, only the first is cache poisoning. The last two are usually called DNS hijacking. For the person who ends up on a fake page, the result is the same.

A famous warning came in 2008, when researcher Dan Kaminsky showed that forging answers was much easier than everybody believed. Software makers fixed it together by randomizing the port of each query, which made guessing far harder. It did not make it impossible.

What attackers want

  • Passwords and card numbers, through copies of real pages.
  • Installing malware, disguised as an update.
  • Reading email, by pointing a domain's mail records to their own server.
  • Blocking content, something some governments and networks do on purpose.
  • Advertising fraud, by sending traffic through pages that pay them.

Signs that something is wrong

  • The browser warns that the certificate isn't valid on a site that never had that problem.
  • A familiar page looks a little different, or asks for data it never asked for.
  • The site works on mobile data but shows something else on your Wi-Fi.
  • Several people on one network see the same strange page.
  • Your domain's records changed and nobody on your team did it.

How to check

Ask two different resolvers for the same domain and compare:

nslookup example.com
nslookup example.com 1.1.1.1
nslookup example.com 8.8.8.8

Different results are not proof by themselves, since large sites answer with different addresses on purpose. But if one answer belongs to an unknown provider, or your own site's address is not the one your hosting gave you, investigate.

If you own a website

1. Protect the accounts first

Most real incidents start with a stolen password, not with clever packets. Use a unique password and two-factor sign-in at your registrar and at your DNS provider, and keep the domain locked against transfers.

2. Turn on DNSSEC

DNSSEC signs your records so that resolvers can detect forged ones. You enable it at your DNS provider and then add one record, called DS, at your registrar. Many providers do both with a click. Do it in that order: a wrong DS record makes your domain unreachable.

3. Use HTTPS everywhere, with HSTS

If somebody is sent to a fake server, that server can't show a valid certificate for your domain, so the browser stops them. HSTS tells browsers to insist on HTTPS. See our guide to free SSL plugins if your site still lacks a certificate.

4. Add CAA records

A CAA record lists which authorities may issue certificates for your domain. It makes it harder to obtain a false one.

5. Watch for changes

Keep a copy of your DNS records and review them now and then. Certificate Transparency services such as crt.sh let you see new certificates issued for your domain.

6. If you run your own DNS server

Keep it updated, don't let it answer recursive queries for the whole internet, and turn on DNSSEC validation.

If you are a visitor

  • Use a resolver that validates DNSSEC and encrypts queries (DNS over HTTPS or TLS). Firefox, Chrome, Android, iOS and Windows all offer it in their settings.
  • Change your router's default password and keep its software up to date.
  • Never click through a certificate warning on a page where you sign in.
  • Let a password manager fill in your passwords. It won't offer them on a domain that isn't the real one. It can't help if the domain is right and the server is false, but then the certificate fails.
  • On public Wi-Fi, use a VPN or your mobile data for anything important.

What to do if it happens

  1. On your device: clear the DNS cache (ipconfig /flushdns on Windows; on a Mac, sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder), check the hosts file and scan for malware.
  2. On your network: reset the router, update it and set its DNS servers again.
  3. On your domain: change the passwords of the registrar and DNS accounts, restore the records from your copy and ask the registrar to review recent access.
  4. For everybody: if somebody may have typed a password, reset it and tell them what happened.

Frequently asked questions

Are DNS poisoning and DNS spoofing the same?

Almost. Spoofing is giving a false answer. Poisoning is when that answer is stored in a cache and served to others.

Does DNSSEC encrypt my queries?

No. It proves that the answer is authentic. DNS over HTTPS or TLS is what hides the query from people on your network. They complement each other.

How long does a poisoned record last?

Until its TTL runs out or somebody clears the cache. That can be minutes or days.

When you register a domain through Phluit you also get an SSL certificate, DNSSEC and WHOIS privacy, which takes care of several points on this list.

Related Articles

VM vs App Hosting: How to Choose Where to Run Your App Cloud & Servers

VM vs App Hosting: How to Choose Where to Run Your App

Compare Phluit VMs and AirLift app hosting for small teams. Learn which fits your app's needs for control, storage, and simplicity.

Dec 1, 2026
Managed WordPress Hosting for Agencies: Buyer's Guide Cloud & Servers

Managed WordPress Hosting for Agencies: Buyer's Guide

Managed WordPress hosting for agencies: what to demand on isolation, backups, rollbacks and support, and the red flags to avoid.

Updated Dec 1, 2026
How to Migrate a WordPress Site Without Downtime Cloud & Servers

How to Migrate a WordPress Site Without Downtime

Learn how to migrate a WordPress site without downtime using staging, low DNS TTLs, and a tested cutover. Get started today.

Updated Dec 1, 2026