Skip to main content

WP 301 Redirects

If users type your real domain and land on a fake site, suspect DNS hijacking first; if your real site loads but contains injected ads, phishing forms, or malware links, suspect a website compromise. Both can redirect visitors to malicious websites, but they happen at different layers. That difference matters because the fix, evidence, and urgency are not the same.

TLDR: DNS hijacking changes where a domain points, so users may be sent to a fake server even though your website files are untouched. A website compromise changes the actual site, often through stolen admin access, vulnerable plugins, or injected scripts. For example, if 10,000 people visit your store and 3,200 suddenly see a fake payment page while your server logs show far fewer visits, DNS hijacking is likely. If all 10,000 hit your server and only checkout pages redirect, the site itself is probably compromised.

The short answer: both can redirect users, but not in the same way

DNS hijacking is like changing the street signs that point to your business. The building may be fine, but visitors are sent somewhere else. Attackers may alter DNS records at the registrar, poison DNS caches, take over a DNS account, or abuse a weak domain management workflow.

Website compromise is like someone breaking into the building and replacing the payment desk. The domain still points to the right server, but the content or code has been changed. Attackers may add JavaScript redirects, hidden iframes, fake login forms, rogue plugins, or server rules that send certain users away.

The catch is that both problems can look almost identical to a customer. They type the right address. They see the wrong page. Then your support team gets a vague message like, “Your site sent me to a crypto giveaway page.” Not very helpful, but very common.

What DNS hijacking looks like

DNS hijacking attacks the system that translates a domain name into an IP address. When DNS is altered, users asking for example.com may be sent to an attacker’s server instead of yours.

Common signs include:

  • Your website files look clean, but users still report fake pages.
  • Traffic drops sharply in your server logs, even while complaints rise.
  • Only some regions are affected, depending on DNS cache and resolver behavior.
  • DNS records changed without an approved request.
  • Email delivery breaks because MX or SPF records were modified.
  • SSL certificate warnings appear because the fake server lacks your valid certificate.

DNS hijacking can be brutally confusing because not everyone sees it at once. One user may reach your real site. Another may reach a fake login page. A third may see an old cached result. Honestly, it feels like chasing smoke when every DNS tool reports a different result for the first few hours.

Attackers often use DNS hijacking for phishing. A fake banking portal, fake webmail page, or fake checkout page can harvest credentials and card details fast. If the domain is trusted, victims are less suspicious. The browser address bar may still show the correct domain if the attacker has also issued or stolen a certificate.

What a website compromise looks like

A website compromise happens when attackers alter your actual site or hosting environment. DNS still points correctly. The server is yours. The content, scripts, or configuration are not.

Common signs include:

  • Injected JavaScript appears in page source.
  • Only mobile users redirect, while desktop users see the normal site.
  • Only visitors from search engines redirect, a common trick to hide from admins.
  • New admin users appear in the CMS.
  • Unknown files show up in upload folders or theme directories.
  • .htaccess, nginx, or PHP files contain strange redirect rules.

Website compromises are often caused by old software. A vulnerable plugin, weak password, exposed admin panel, or stolen FTP credential can be enough. Once inside, attackers may add redirects that trigger only under specific conditions. That makes the attack harder to reproduce.

It drives me crazy that some malware waits five or ten seconds before redirecting. The page loads normally, the user starts reading, and then the browser jumps to a scam site. That delay makes screenshots, support tickets, and automated scans less useful.

DNS hijacking vs website compromise: key differences

QuestionDNS HijackingWebsite Compromise
Where is the attack?Registrar, DNS provider, resolver, or DNS recordsWebsite files, CMS, database, server, or hosting account
Does the real server get traffic?Often no, or much less than expectedYes, traffic usually reaches the server
Are site files changed?Usually noOften yes
Who can help first?Registrar or DNS providerHost, developer, incident response team
Main risk?Full domain impersonationMalware, phishing, data theft, spam redirects

A practical user case scenario

Imagine a regional online pharmacy with about 40,000 visits per week. On Monday morning, support receives 86 complaints in two hours. Customers say the checkout page asks for card details twice. Analytics shows a 38% drop in completed orders, but the hosting dashboard shows normal server health.

The team checks the site files first. No strange JavaScript. No new plugins. No suspicious admin users. Then they compare DNS records from five public resolvers. Two resolvers return an unknown IP address in another country. That points to DNS hijacking, not a website compromise.

Now change one detail. The DNS records are correct everywhere, but the checkout page contains an unfamiliar script loaded from a random domain. Server logs show every affected visitor reaching the real server. That points to a website compromise.

How to confirm which breach you have

Use a fast triage process. Do not guess based on screenshots alone.

  1. Check DNS from multiple locations. Compare A, AAAA, CNAME, NS, and MX records using several resolvers.
  2. Compare server logs with analytics. If analytics reports traffic but your server does not see it, suspect DNS.
  3. View page source. Look for unknown scripts, iframe tags, encoded code, or strange redirect logic.
  4. Test with different devices. Use mobile data, office Wi Fi, VPN locations, and private browsing.
  5. Review recent account activity. Check registrar logins, DNS changes, CMS admins, FTP access, and hosting control panel events.
  6. Scan server files. Compare against known clean backups where possible.

How to respond to DNS hijacking

If DNS is hijacked, act at the domain level first. Lock the domain. Reset registrar and DNS provider passwords. Remove rogue records. Restore correct nameservers. Enable multi factor authentication. Review API keys and delegated access.

Then shorten the damage window. Lower TTL values only after control is restored. Notify customers if phishing may have occurred. Check certificates issued for your domain using certificate transparency logs. If email records were changed, review mail abuse too. Stolen email can reset other accounts.

How to respond to a website compromise

If the site is compromised, take a clean backup for evidence before changing too much. Then remove malicious code, patch the CMS, update plugins, rotate passwords, and check admin users. Review server cron jobs, upload folders, and config files. Attackers love backdoors because they hate doing the same work twice.

Restore from a known clean backup if you can prove it predates the breach. If not, rebuild key parts. After cleanup, scan again from outside the network. Test as a normal visitor, not only as an admin. Some redirects hide from logged-in users.

How to reduce the chance of both attacks

  • Use multi factor authentication on registrar, DNS, hosting, CMS, and email accounts.
  • Enable registry lock for high-value domains.
  • Limit DNS permissions so only approved staff can edit records.
  • Patch software quickly, especially CMS plugins and themes.
  • Monitor certificate issuance for your domains.
  • Set file integrity monitoring for website code.
  • Keep clean backups and test restores before a crisis.

The main clue is where the unwanted redirect begins. If the domain points to the wrong place, you are dealing with DNS hijacking. If the domain points correctly but the site misbehaves, you are dealing with a website compromise. Find that split first, and the response becomes much faster.