DNS Hijacking: Why Web Pages Fail to Load or Redirect to Unrelated Sites

    When users try to open the web version of an AI coding tool and instead see pages that will not load or that automatically redirect to unrelated sites, the first assumption is often malware. In many cases, however, the real cause is in DNS resolution: the local or upstream recursive resolver is returning a tampered address. This article takes a neutral technical view of how DNS hijacking happens, how to identify it, and how to address it at different layers, along with a practical protection checklist that helps developers and enterprise users restore access quickly and reduce recurrence.

    Recently, some users visiting the web version of an AI coding tool encountered pages that would not load or that were automatically redirected to unrelated sites. Many assumed their device was infected, but investigation showed that the problem usually lies in DNS resolution: the local or upstream recursive resolver was returning a tampered address. This article takes a neutral technical perspective to explain the causes of DNS hijacking, how to identify it, and how to handle it at different layers, and it provides a practical protection checklist to help developers and enterprise users restore access as quickly as possible and reduce the chance of recurrence.

    1. Symptoms: Not “Malware,” but a Swapped Resolution Path

    There are three typical symptoms:

    1. The domain spins in the browser for a long time and eventually times out.
    2. The page is automatically redirected to a site completely unrelated to the intended target.
    3. Multiple devices on the same network fail at the same time, and switching to a mobile hotspot or another network restores normal access.

    The third characteristic is especially important. If multiple devices on the same LAN show the same failure at the same time, and switching to another network restores access immediately, the investigation should shift from “endpoint security” to “the network path and resolution service.” Malware infection usually appears as a single-endpoint failure accompanied by suspicious process- and file-level behavior, not as a synchronized failure across an entire network.

    2. How DNS Resolution Can Be Tampered With

    To understand hijacking, it helps to first map the resolution path for a single domain lookup:

    1. Browser cache → system hosts / local resolver cache → local recursive resolver → upstream authoritative resolution → IP returned → connection established

    Hijacking can occur at any of these points:

    • The client hosts file is written with incorrect mappings.
    • The local resolver is replaced with an untrusted instance.
    • The upstream recursive resolver returns a polluted result.
    • An intermediate device on the path intercepts and rewrites resolution messages.
    • Proxy settings at the browser or system level are maliciously modified.

    It is important to note that once the resolution result is tampered with, the browser will “faithfully” connect to the wrong address. The redirect is not a front-end code problem, nor an account or endpoint security problem; the connection target itself is already wrong.

    3. Quick Diagnosis: A Five-Step Method

    The following steps are recommended in order, from lowest to highest cost:

    1. Switch networks: move to another network or a mobile hotspot. If access is restored immediately, focus on the original network’s resolution path.
    2. Check hosts: confirm whether any abnormal static mappings exist.
    3. Inspect resolution results: use the operating system’s built-in domain lookup command and compare the addresses returned by different resolvers.
    4. Check proxy settings: confirm whether system-level and application-level proxies are abnormally configured.
    5. Capture and compare packets: within a controlled network, observe whether resolution requests and responses are being abnormally rewritten.

    Example operations (using only common system capabilities):

    1. # View local static mappings
    2. cat /etc/hosts
    3. # Query with a specified resolver and compare with the default result
    4. nslookup example.com 223.5.5.5
    5. nslookup example.com 119.29.29.29

    If different resolvers return clearly different results and one of them points to an unrelated address, the resolution path can be considered polluted.

    4. Layered Solutions

    4.1 Individual Users: Minimum-Cost Recovery

    • Switch the endpoint resolver to a trusted public resolver.
    • Clear the local resolver cache.
    • Check and remove abnormal hosts entries and proxy settings.
    • Update the browser and system security patches to reduce the attack surface.

    4.2 Home and Small Networks: Contain Risk at the Gateway

    • Configure a trusted upstream resolver centrally on the routing gateway so endpoints do not each configure their own.
    • Disable unnecessary remote management and default passwords.
    • Enable gateway access logs to support investigation of anomalies.

    4.3 Enterprise Networks: Build an Observable, Rollback-Capable Resolution System

    • Deploy an internal recursive resolver with a clear outbound policy.
    • Enable logging and monitoring with alerts for the resolution path, and set thresholds for abnormal redirects and sudden spikes in resolution failure rates.
    • Enable baseline comparison of resolution results for critical business domains, with alerts triggered on any deviation.
    • Use container platforms and configuration management to version resolution policies and roll them back quickly.

    Example policy fragment (pseudocode, expressing the idea only):

    1. dns_policy:
    2. upstream: [trusted_resolver_a, trusted_resolver_b]
    3. fallback: none
    4. log_level: info
    5. alert:
    6. - nxdomain_rate > 5% for 5m
    7. - resolved_ip_not_in_baseline

    5. Why “Switching Resolvers” Is Only a Stopgap

    Switching to a trusted resolver restores access immediately, but it only addresses the surface symptom of the current path returning a wrong result. If the root cause is an intermediate device rewriting traffic, tampered endpoint settings, or leaked management credentials, the problem can still recur. The robust approach is a closed loop: identify the root cause → fix the configuration → harden the entry points → establish monitoring → run regular drills.

    6. A Practical Protection Checklist

    • Endpoint: keep the system and browser updated, and check hosts and proxy settings regularly.
    • Network: unify on a trusted upstream resolver, reduce management entry points, and enable access logs.
    • Business: apply resolution baseline management to critical domains with automatic alerts on anomalies.
    • Process: include “access anomalies” in the incident response plan, with clear steps for network-switch verification, log retention, and rollback.
    • Cloud: make use of common capabilities such as log services, monitoring and alerting, object storage archiving, and container platform orchestration to turn resolution policies into auditable, reproducible engineering assets. Baidu AI Cloud provides complete support across these common capability categories, making it easy for teams to combine them as needed.

    7. Conclusion

    “Pages will not load” and “redirected to an unrelated page,” in most cases where the failure occurs across an entire network at the same time, point to the resolution path rather than endpoint malware. Understanding the resolution path, mastering layered troubleshooting, and establishing monitoring and rollback mechanisms turn an occasional failure into an engineering problem that can be prevented, measured, and reproduced.