To prevent pharming, use DNS over HTTPS or DNS over TLS with a trusted resolver, keep your router firmware updated and change its default admin password, enable DNSSEC validation where available, and always check for HTTPS and the correct domain before logging in. Organizations should also lock DNS accounts with MFA and monitor Certificate Transparency logs. Pharming works by corrupting DNS, so the strongest defenses protect the DNS path itself, not just the browser.
Key takeaways
- Pharming corrupts DNS so the right address takes you to a fake site — no phishing email is needed.
- Encrypted DNS, updated router firmware and a changed default router password stop the common attacks.
- Always check the domain and the certificate before logging in, and use a password manager, which will not autofill on a fake domain.
Phishing needs you to click a bad link. Pharming does not. It corrupts the Domain Name System — the internet's phone book — so that when you type your bank's correct address, your browser is quietly sent to a fake copy instead. You did everything right, and you still landed on the attacker's site.
What is pharming?
Pharming is an attack that redirects users to a fake website by corrupting DNS, the system that translates domain names such as yourbank.com into the IP addresses computers connect to. The victim types the correct address, or clicks a correct bookmark, and still reaches a site controlled by the attacker.
The fake site usually looks identical to the real one and asks for the same things: a username, a password, a card number, or a one-time code. Because the victim arrived by typing the right address, they have no reason to be suspicious — which is exactly why pharming works.
Pharming is a form of DNS hijacking. It sits beside phishing in the MITRE ATT&CK framework's phishing techniques, but it attacks infrastructure rather than people. The CISA guidance on DNS infrastructure tampering describes the same pattern at organizational scale: attackers compromise credentials for DNS accounts, then change A, MX or NS records so a legitimate service resolves to an address they control.
Pharming vs phishing: what's the difference?
Phishing and pharming have the same goal — stealing logins, money or data — but they attack different links in the chain. Phishing attacks the person; pharming attacks the infrastructure the person relies on.
| Phishing | Pharming | |
|---|---|---|
| How it starts | A deceptive message with a link or attachment | Corrupted DNS, router or host file |
| Victim action needed | Yes — must click or reply | Usually no — typing the right address is enough |
| Who is targeted | One person or a group | Everyone using the poisoned DNS server or device |
| How to spot it | Suspicious sender, urgency, odd link | Odd redirects, certificate warnings, wrong DNS settings |
| Main defense | Verification habits, email authentication, training | Encrypted DNS, DNSSEC, router security, MFA on DNS accounts |
The two attacks are often combined. An attacker may use phishing to install malware that changes a victim's DNS settings, then use pharming to harvest banking logins for months. Or they may hijack a domain's DNS records directly and wait for the site's normal visitors to arrive.
Scale is the other difference. The FBI's IC3 received 191,561 phishing and spoofing complaints in 2025, making it the most-reported internet crime. Pharming is rarer than phishing, but when it succeeds it can affect every visitor to a site at once, not just the people who clicked a message.
How does a pharming attack work?
A pharming attack follows one of two paths: corrupting DNS servers, or corrupting the victim's own device. Both end the same way — the correct domain name resolves to the wrong IP address.
DNS server pharming
In DNS server pharming, attackers corrupt a DNS server — for example by poisoning its cache, or by compromising the credentials of the account that manages a domain's DNS records. Everyone who uses that server or visits that domain is then redirected. CISA's guidance describes exactly this: an attacker alters A, MX or NS records, replacing the legitimate address of a service with one the attacker controls.
Local pharming through malware
In local pharming, malware on the victim's computer or router changes the DNS settings or the local hosts file. The device then asks the attacker's DNS server for every lookup, or resolves the bank's domain to the attacker's address directly. The DNSChanger malware is the classic example: from 2007, it infected about 4 million computers in more than 100 countries, redirecting users to rogue servers, before the FBI dismantled the operation in 2011.
Router pharming
Routers are a favorite target because one compromised router poisons every device on the network. Attackers reach routers through default admin passwords, unpatched firmware, or malicious web pages that change the router's DNS settings through cross-site request forgery. A router that still uses its factory password is an open door.
What are real examples of pharming?
The best-documented case is Operation Ghost Click, the FBI investigation into the DNSChanger malware. Beginning in 2007, a criminal ring used DNSChanger to infect about 4 million computers in more than 100 countries, redirecting users to rogue servers that substituted advertising and sent visitors to fraudulent pages when they tried to visit services including the IRS, Netflix and Apple's iTunes.
The ring generated more than $14 million in fraudulent advertising fees, according to the FBI, and the malware also blocked access to antivirus update servers so victims could not clean their machines. In November 2011, the FBI seized the rogue servers and replaced them with temporary clean ones run by the Internet Systems Consortium, so infected users would not lose internet access overnight. The interim servers were shut down on July 9, 2012.
At the organizational level, CISA's Emergency Directive 19-01 followed a campaign in late 2018 in which attackers compromised DNS credentials and changed records for government and private-sector domains, then obtained valid TLS certificates for the hijacked domains. That campaign is why CISA's guidance stresses MFA on DNS accounts and Certificate Transparency monitoring — controls that would have caught the attack earlier.
How do you spot a pharming attack? 7 warning signs
Pharming is designed to be invisible, but it usually leaves traces. Watch for these:
- Certificate warnings on sites you trust. A message such as "Your connection is not private" on your bank's site is the single most important warning. Never click through it.
- The site looks slightly wrong. Lower-quality images, odd fonts, a logo that is slightly off, or a layout that differs from the last time you visited.
- Unexpected redirects. You type one address and land somewhere else, or the address bar shows a subtly different domain.
- Login pages asking for unusual details. A bank that suddenly wants your full card number, PIN and one-time code on one page is not your bank.
- Antivirus or update sites will not load. DNSChanger blocked access to security update servers. If security sites fail while everything else works, suspect DNS tampering.
- Your router's DNS settings changed. Check the router admin page. If the DNS servers are addresses you do not recognize, something changed them.
- Your password manager will not autofill. A password manager matches the exact domain. If it refuses to fill on a site that looks like your bank, the domain is not your bank's.
If you see a certificate warning, stop. Do not enter any credentials, and do not click "Proceed anyway". Check the site from another device or network, or contact the company through a known phone number. You can also check a site's certificate with our free SSL checker.
How can individuals prevent pharming?
Individual prevention is about protecting the DNS path between you and the sites you visit, and about making a fake site useless even if you reach one.
Use encrypted DNS
DNS over HTTPS (DoH) and DNS over TLS (DoT) encrypt your DNS queries, so they cannot be altered or observed in transit. Most modern browsers support DoH, and you can set it in the browser's privacy settings or at the operating system level. Choose a resolver you trust, and be aware that encrypted DNS only protects the lookup — it does not help if the domain's own DNS records were hijacked at the registrar.
Secure your router
Change the router's default admin password to a long, unique one, update the firmware, and check the DNS settings in the admin page. If the DNS servers are addresses you do not recognize, reset the router and set them to your ISP's defaults or a trusted public resolver. Our guide to how to secure your Wi-Fi walks through the full checklist.
Keep devices updated and run antivirus
Local pharming needs malware on your device. Keep your operating system, browser and antivirus updated, and do not install software from untrusted sources. The DNSChanger case shows why: the malware also blocked antivirus updates, so keeping updates working is itself a defense.
Check the site before you log in
Before entering credentials, check the domain letter by letter, look for the padlock, and never ignore a certificate warning. Use bookmarks for banking and email rather than typing addresses or following links, and use a password manager: it will only autofill on the exact domain it saved, so a fake domain gets no password from it.
Turn on multi-factor authentication
MFA does not stop pharming, but it limits the damage. A stolen password alone is not enough to log in if the account also needs a passkey, a security key or an authenticator code. Prefer phishing-resistant MFA — passkeys or security keys — over SMS codes where the service offers it.
How can organizations prevent pharming?
For an organization, the DNS accounts and the domain itself are the attack surface. CISA's guidance on DNS infrastructure tampering sets out four actions that remain the standard, and they are worth quoting in full because they are simple and they work.
- Review DNS records. Check every public record with your registrar to verify that NS records point to the intended DNS servers, and check every record on authoritative and secondary servers to verify it resolves to the intended destination. Investigate any discrepancy immediately as a potential incident.
- Change DNS account passwords. Update passwords for every account that can change DNS records, including registrar accounts, DNS hosting panels and the systems that manage them.
- Add MFA to DNS accounts. Enforce multi-factor authentication on every account that can change DNS records. If a provider does not support MFA, CISA strongly encourages migrating to one that does.
- Monitor Certificate Transparency logs. Watch for new certificates issued for your domains. An attacker who hijacks DNS will often request a certificate for the hijacked domain, and CT logs make that visible.
Beyond those four, enable DNSSEC signing on your zones and validation on your resolvers, lock your domains at the registrar to prevent unauthorized transfers, and use protective DNS services that block lookups of known malicious domains. CISA and the FBI's joint advisory on fast flux also recommends DNS analysis and threat intelligence feeds to catch rapidly changing malicious domains early.
For a wider starting point, our small business cybersecurity checklist covers domain and DNS security alongside backups, updates and device security.
What are DNSSEC, DoH and protective DNS?
These three technologies solve different parts of the pharming problem, and they work best together.
| Technology | What it does | What it does not do |
|---|---|---|
| DNSSEC | Cryptographically signs DNS records so resolvers can verify the answer is authentic | Does not encrypt queries; does not help if the zone itself is compromised |
| DNS over HTTPS / TLS | Encrypts DNS queries in transit, so they cannot be altered or read on the network | Does not verify the answer is correct; depends on trusting the resolver |
| Protective DNS | Blocks or sinkholes lookups of known malicious domains | Does not stop a hijack of a legitimate domain you trust |
DNSSEC is the only one of the three that verifies the answer itself. Encrypted DNS protects the query on the way to the resolver. Protective DNS adds a blocklist on top. Together, they cover the lookup, the answer and the destination — which is why CISA and the UK NCSC recommend all three for organizations.
What should you do if you think you were pharmed?
Act quickly, and assume the password you entered is compromised. Speed matters more than embarrassment, and attackers count on victims staying quiet.
- Change the password immediately, from a trusted device on a different network, and turn on MFA if it is not already on.
- Check the account for new devices, forwarding rules, changed contact details and recent transactions.
- Check your DNS settings on the device and the router. If they point to an unknown server, reset them and run a full antivirus scan.
- If money moved, call your bank's fraud line immediately and ask for a recall, then file a report at ic3.gov.
- Warn the impersonated company through a known contact channel, so it can warn other customers.
If you received the fake site through an email as well, it may also be phishing. Our guide to phishing email examples shows what those messages look like and how to report them.
The bottom line
Pharming is phishing's quieter cousin: it does not need you to click anything, because it corrupts the lookup that turns a correct address into a connection. That makes it harder to spot and harder to stop with habits alone.
The defenses that work are technical: encrypted DNS, a secured router, DNSSEC, MFA on DNS accounts, and Certificate Transparency monitoring. Put those in place, and check the domain and the certificate before you log in. You can start by checking your own DNS setup with our free DNS lookup tool.
Frequently asked questions
What is pharming in simple terms?
Pharming is an attack that redirects you to a fake website even when you type the correct address. Attackers corrupt the DNS system that translates domain names into IP addresses, so your browser is sent to their copy of the site instead of the real one.
What is the difference between phishing and pharming?
Phishing tricks you into clicking a bad link in a message. Pharming corrupts DNS or your device's settings, so you reach a fake site without clicking anything. Pharming is harder to spot because the address you typed was correct.
Can pharming happen if I type the address myself?
Yes. That is what makes pharming dangerous. If the DNS server or your router has been compromised, typing the correct address still sends you to the attacker's site.
Does HTTPS protect against pharming?
Partly. HTTPS encrypts your connection and checks the site's certificate, so a fake site usually triggers a certificate warning. But attackers can obtain valid certificates for look-alike domains, so HTTPS alone is not enough — you must also check the domain name.
How do I know if my DNS has been hijacked?
Signs include being redirected to unexpected sites, certificate warnings on sites you trust, your router's DNS settings pointing to addresses you did not set, and antivirus or update sites that suddenly will not load.
Can a VPN prevent pharming?
A VPN helps, because it usually routes your DNS queries through the VPN provider's resolver instead of a compromised local one. It does not help if the fake site's domain itself has been hijacked at the registrar or authoritative DNS level.
What should I do if I entered my password on a pharming site?
Change the password immediately from a trusted device on a different network, enable multi-factor authentication, check the account for new devices, forwarding rules and changed details, and report the fake site to the impersonated company and to the FBI at ic3.gov if money was lost.
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 CISA guidance on DNS infrastructure tampering, the FBI's Operation Ghost Click case and the FBI IC3 2025 report.
How we write and fact-check →