WordPress DNS Hijack or Redirect Malware? Compare DNS, CDN, and Origin Evidence

WordPress DNS hijack investigation separating a secure domain route from a malicious redirect path

A WordPress redirect can come from DNS, a CDN edge rule, the origin server, or WordPress malware. Compare the same URL at each delivery layer before editing .htaccess, changing DNS, or clearing evidence.

RyoheiYokoyama

I’m Ryohei Yokoyama, founder of SiteFixNow. With over 20 years of IT engineering and practical WordPress recovery experience, I separate DNS, CDN, origin, and application evidence so cleanup targets the layer that produced the redirect.

What you’ll learn
  • How to distinguish DNS or registrar compromise from WordPress redirect malware.
  • How to compare public DNS, CDN responses, and the confirmed origin without changing production first.
  • Which headers, logs, files, and WordPress settings identify the redirecting layer.
  • How to recover accounts and content in the right order, then verify every path.
On This Page

WordPress DNS Hijack and Redirect Malware Produce Different Evidence

Key decision

Classify the redirect by the first layer that changes the destination: DNS answer, CDN response, origin response, or WordPress execution.

DNS maps a hostname to infrastructure; it does not normally return an HTTP Location header. A hijack begins with an unexpected delegation or address that sends visitors to infrastructure the owner did not approve.

Origin redirects come from the web server, hosting configuration, or application at the real server. WordPress causes include altered options, injected code, compromised components, or database payloads; the .htaccess malware guide covers only one mechanism.

WordPress DNS Hijack Checks Start With Authoritative Records

Key decision

Record delegation and answers from independent resolvers before editing a zone, flushing caches, or changing nameservers.

Compare the registrar’s nameservers with authoritative delegation, then query A, AAAA, and CNAME through two independent resolvers. Save timestamps, TTLs, resolver names, and the approved change record because planned migrations can temporarily differ.

Before repair, preserve the zone export, registrar and DNS audit logs, account users, tokens, nameserver changes, and DNSSEC state. If delegation is wrong, edits inside the former DNS provider may have no effect.

# Replace example.com; save the time and resolver used.
dig +short NS example.com
dig +noall +answer A example.com @1.1.1.1
dig +noall +answer AAAA example.com @8.8.8.8
dig +noall +answer CNAME www.example.com @1.1.1.1
dig +trace example.com

WordPress CDN and Origin Tests Must Use the Same Hostname

Key decision

Compare the public route with the confirmed origin while preserving the hostname and TLS name; an IP-only test can hit the wrong virtual host.

Test the origin only after its owner confirms the address. curl --resolve changes resolution for one request while retaining the hostname for TLS and HTTP; never use an unverified historical address or violate origin-access policy.

If the public route redirects but the origin does not, inspect edge rules, workers, routing, and cache state. If both redirect identically, inspect origin logs and WordPress; the cache malware workflow explains why purging first can hide evidence.

# Public route; do not follow the redirect yet.
curl -sS -o /dev/null -D - https://example.com/affected-path

# Confirmed origin only, with owner authorization.
curl -sS -o /dev/null -D - \
  --resolve example.com:443:192.0.2.10 \
  https://example.com/affected-path
Evidence flow comparing DNS, CDN, origin server, and WordPress redirect responses

WordPress Redirect Malware Evidence Appears at the Origin or Application

Key decision

When the origin reproduces the redirect, trace server configuration and WordPress instead of assuming DNS remains responsible.

Verify WordPress home and siteurl through an authenticated route and compare them with wp-config.php. WordPress distinguishes Site Address from WordPress Address, and a wrong value can cause a legitimate loop or an attacker-controlled redirect.

Reproduce conditional redirects for logged-out, mobile, referrer, country, and first-visit cases in an isolated matrix. Use the mobile redirect guide and the files and database checklist for the affected layer.

wp option get home
wp option get siteurl
wp config get WP_HOME
wp config get WP_SITEURL
rg -n 'bad-domain\.example|wp_redirect|wp_safe_redirect' \
  wp-config.php .htaccess wp-content/themes wp-content/plugins wp-content/mu-plugins

WordPress DNS Hijack Recovery Must Secure Accounts Before Content

Key decision

Recover the controlling account for the affected layer, preserve its history, then restore approved configuration and clean WordPress where evidence requires it.

For registrar or DNS compromise, recover the provider account, secure its email, remove unauthorized users and tokens, rotate credentials, and restore approved delegation. Enable MFA and configure DNSSEC only after the registrar and DNS provider agree.

For WordPress compromise, replace altered components from trusted sources, repair targeted database values, remove unauthorized users or tasks, patch the entry point, and rotate relevant credentials. Changing DNS alone does not clean an infected origin.

If redirects return, stop repeating deletion. Follow the reinfection root-cause workflow to find a surviving writer, stolen account, vulnerable component, or neighboring compromised site.

WordPress DNS Hijack Verification Requires a Four-Layer Matrix

Key decision

Close the incident only when DNS, public CDN delivery, the confirmed origin, and WordPress match the approved state across relevant conditions.

After the expected TTL, requery delegation and records through independent resolvers. Confirm registrar nameservers, authoritative answers, DNSSEC where enabled, IPv4 and IPv6 routes, and the absence of unauthorized users, tokens, forwarding, or transfer requests.

Repeat public and origin tests for the home page, affected path, login, and a static asset. Compare status, Location, certificate name, cache indicators, logs, clean profiles, mobile conditions, and the original targeting trigger.

Confirm WordPress URL settings, file baseline, database findings, users, tasks, security keys, and patched components. Monitor DNS, CDN rules, files, outbound requests, and privileged logins through the recurrence period; one clean refresh is not proof.

WordPress DNS Hijack vs Redirect Malware FAQ

Key decision

Use the first layer that changes the result to decide where evidence collection and recovery should begin.

Can WordPress malware change DNS records?

WordPress code does not normally control DNS, but the same incident may expose registrar, DNS-provider, or API credentials. Investigate those accounts separately from site files.

Does a different IP address prove DNS hijacking?

No. CDNs, migrations, load balancing, and IPv4 or IPv6 can produce expected differences. Compare authoritative records with the approved provider inventory.

Why does the CDN redirect while the origin does not?

An edge rule, worker, routing rule, or cached response may be responsible. Preserve headers and request IDs, correct the edge configuration, then purge only affected objects.

Should I keep editing .htaccess until the redirect stops?

No. First prove that the confirmed origin and .htaccess layer produce it. DNS, CDN, PHP, database, theme, plugin, and browser conditions require different evidence and fixes.

WordPress DNS Hijack or Redirect Malware Is Solved by Layered Evidence

Key decision

Preserve the route, compare DNS, CDN, origin, and WordPress, repair the controlling account or writer, and verify the complete path.

A redirect is a symptom, not a location. Keep the hostname and path constant while comparing each layer, then repair the registrar, DNS, CDN, origin, or WordPress system that changed the result.

If You Can’t Secure or Recover Your WordPress Site Yourself

Ryohei Yokoyama, founder of Site Fix Now — WordPress site recovery, repair, defacement, malware removal and site hijacking specialist. Recovery in as little as 30 minutes.

If your website shows malware warnings, redirects to strange pages, or you are not sure whether it is secure,
SiteFixNow can help clean, repair, and recover your WordPress site.

Common problems we can help with
  • Your WordPress site may be infected with malware.
  • Security warnings appear in Google or browser results.
  • You found unknown admin users or suspicious files.
  • The site redirects to spam or unknown websites.
  • You need urgent WordPress hacked site repair.

We help with WordPress malware removal, hacked site repair, security cleanup, and recovery support.

Why ask for help early?
  • Reduce visitor risk and SEO damage.
  • Find hidden malware and backdoors, not only visible symptoms.
  • Recover the site safely without unnecessary data loss.

About the Author

Hello, I’m Ryohei Yokoyama, an IT engineer with over 20 years of experience.

I have received more than 776 reviews for WordPress recovery,
website repair, and online courses.

Many clients have shared comments such as:

“They restored my site so quickly!”
“They handled it the same day, which was a huge help!”

I am proud to have received a very high rating of 4.9 out of 5.0.

I have also published more than 30 books on WordPress, SEO, Microsoft Office, and related topics,
with multiple titles reaching No. 1 in sales rankings.

In addition, I have created more than 3,000 services, systems, and websites.

Through this experience, I have helped many people overcome technical problems, frustrations, and challenges.
Based on that practical perspective,
I explain complex topics in a clear and easy-to-understand way.

On This Page