Hosts file poisoning is the tampering of a computer’s local hosts file to make a domain name resolve to an attacker-chosen IP address. It overrides normal DNS lookups on that device, which can redirect traffic to malicious services, enable phishing, or block access to legitimate hosts.
Why hosts file poisoning matters
Hosts file poisoning is dangerous because it subverts name resolution on the local device, before normal DNS controls can help. Once a domain is mapped to an attacker-controlled address, the user may be sent to a lookalike service, a malicious update site, or an infrastructure endpoint that the organisation never intended to trust.
The attack is especially effective because the local hosts file is often treated as a simple operating system configuration rather than a security boundary. That makes it a quiet place to alter behaviour, and it can persist until the file is checked, corrected, or overwritten by a trusted management process.
How the hosts file changes name resolution
The hosts file is a local lookup table that can override DNS results on a per-device basis. When an entry exists for a domain, the system may use that local mapping instead of querying DNS, which means the device will resolve the name to the IP address specified in the file.
This override is powerful because it affects whatever application relies on the operating system resolver. Browsers, update agents, command-line tools, and some enterprise software can all inherit the poisoned resolution path, so the impact is not limited to one application.
That local precedence is why Host Header Attacks and Validation Guide is useful context here: it explains related trust failures around host validation, reset link poisoning, and proxy handling, all of which can amplify the damage when name resolution is manipulated.
Common abuse paths and operational consequences
Attackers use hosts file poisoning to redirect victims to phishing pages, block access to security or support sites, or steer traffic toward infrastructure they control. In practice, that can support credential theft, malware delivery, session capture, or simple disruption by making legitimate destinations unreachable.
It is also a useful persistence and evasion technique because the traffic still looks locally normal from the device’s point of view. If defenders only inspect DNS logs, they may miss the change entirely, since the lookup never reaches their resolver.
In remediation work, poisoned local mappings are often treated alongside DNS tampering because both can create the same user-visible symptom, namely traffic going to the wrong place. For a practical cleanup path, D3-DNSCE DNS Cache Eviction is relevant for understanding how poisoned resolution state is flushed and verified, even though hosts file changes themselves still need direct removal.
Detection, verification, and recovery
Defenders should verify the local hosts file on suspected endpoints, compare it with a known-good baseline, and check whether affected domains resolve differently on the device than they do from a trusted resolver. Differences between local resolution and network resolution are often the first clue that the endpoint has been tampered with.
Post-incident review should also look for related compromise indicators, such as altered security tool destinations, redirected login portals, or unusual changes to system files. If the poisoned mapping was used to intercept credentials or sessions, those authentication artefacts should be treated as potentially exposed and reviewed for reuse or abuse.
Where the broader pattern suggests name-resolution manipulation rather than a single file edit, DNS validation, proxy inspection, and host-based integrity checks should all be used together. A poisoned hosts file is small, but the trust break it creates can be broad.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
MITRE ATT&CK addresses the attack and risk surface, while CIS Controls v8 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| MITRE ATT&CK | T1565.001 — Stored Data Manipulation: Stored Data Manipulation | Hosts file poisoning alters local name-resolution data on an endpoint. |
| Recommendation — Detect and alert on unauthorized changes to local name-resolution files and compare them with trusted baselines. | ||
| CIS Controls v8 | CIS-4 — Secure Configuration of Enterprise Assets and Software | Hosts file poisoning is a configuration tampering issue on endpoints. |
| Recommendation — Enforce secure baseline configurations and monitor for unauthorized changes to system files. | ||
| NIST SP 800-53 Rev 5 | CM-5 — Access Restrictions for Change | This attack depends on unauthorized modification of a protected system file. |
| SI-7 — Software, Firmware, and Information Integrity | Poisoned hosts files undermine the integrity of local resolution information. | |
| AU-9 — Protection of Audit Information | Detection depends on trustworthy logs and change records for endpoints. | |
| Recommendation — Restrict who can alter endpoint configuration files and log every approved change. Verify endpoint file integrity and investigate unexpected changes to resolver-related files. Protect audit trails so tampering with name-resolution files can be investigated reliably. | ||
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 18, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org