Find the file and copy it
The hosts file is a plain text file without an extension. Windows protects it, so copy it to the desktop, edit the copy and write it back.
%SystemRoot%\ystem32\rivers\tc\osts
The hosts file resolves a domain to an address you choose. Point known ad servers at nothing and every program on the machine stops reaching them.
Add lines of the form **0.0.0.0 domain.tld** to the hosts file in **drivers\tc**, keep a backup, and clear the DNS cache afterwards. It blocks by name only, so a hardcoded IP is unaffected.
The hosts file is a plain text file without an extension. Windows protects it, so copy it to the desktop, edit the copy and write it back.
%SystemRoot%\ystem32\rivers\tc\osts
Each line starts with an address, then one or more names, separated by spaces. Comments start with a hash. A wrong separator turns the line into a comment or an error.
0.0.0.0 ads.example.com
A curated list of a few dozen domains is maintainable. A downloaded list with a hundred thousand entries slows every name lookup and breaks services you use.
Notepad saves UTF-8 by default, which is fine. The file must keep the name hosts with no extension; a hosts.txt file is ignored completely.
Windows caches resolved names. Without a flush the new entries apply only after the cache expires, which looks like the edit did nothing.
ipconfig /flushdns
A hosts file that breaks a sign-in page is a five-second fix with a backup. Store the original as hosts.bak and swap it back when something misbehaves.
copy hosts hosts.bak
The editor is not elevated. Open it as administrator or edit a copy and copy it back.
The file has an extension, the cache was not flushed, or the site uses a different domain.
A shared content domain is on the list. Remove that line and flush again.
A very large list. Cut it down to what you actually need.
Only if those apps use DNS names and do not fall back to hardcoded addresses.
Yes. Windows does not reset the hosts file unless a third-party tool rewrites it.
Restore **hosts.bak** over the hosts file, or delete your added lines and run **ipconfig /flushdns**. All lookups return to normal.
Free · no account needed · tracks your progress