How to Block Distracting Websites on Windows (2026 Guide)
Point a website at 127.0.0.1 in the Windows hosts file. A browser extension can block that same website inside one browser. A DNS change can block the name for every browser on the PC. LiquidFocus is a narrower control than the hosts file or a DNS change.
During a running work timer, a local helper on 127.0.0.1 tells the PeakFlow browser extension which names to block. The default names are YouTube, Facebook, Instagram, Reddit, TikTok, Netflix, Twitter, and X. The block lasts only for the length of that running work timer. It is not a block for every program on the PC by itself.
A page that never loads removes the choice to stay there. That is the practical reason to block a name during a hard task. The Windows setup for a long stretch of real work is the wider desk around this one control.
Hosts file
Hosts file
The hosts file is the map from a website name to an address. Pointing that name at 127.0.0.1 keeps the page on this PC. Every browser on the machine reads that same file.
Steps
- Press Win+X, then choose Terminal (Admin) from that power menu.
- Run notepad on the hosts file path from that admin window.
- Add one line for each name you want kept off this PC.
127.0.0.1 www.reddit.com
127.0.0.1 reddit.com
127.0.0.1 www.twitter.com
127.0.0.1 twitter.com
127.0.0.1 www.youtube.com
127.0.0.1 youtube.com
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
- Save the hosts file from Notepad, then close that Notepad window.
- Run the DNS flush command shown below from that same admin terminal.
ipconfig /flushdns - Restart the browser to make it read the new hosts lines.
What you get
- The hosts file is free for every browser on that PC.
- No extra program has to stay running in the background.
What to watch
- Saving the hosts file requires an admin account on this PC.
- You can undo the block later by editing that same file again.
- A VPN or a proxy can still reach around a hosts-file block.
A family account
Microsoft Family Safety
Microsoft Family Safety can block names for a second account on the PC. It is built for a family member, and you can point it at an account you use yourself.
Steps
- Open the Family and other users page under Accounts in Settings.
- Add a family member, or pick an account you already have.
- Open the family website on a second device you still control.
- Open content filters for that family member on the website.
- Add the website name to the blocked list for that person.
- Sign in to the restricted account during the hours you want the filter.
What you get
- The filter is a Microsoft account control, with no extra installer.
- You can change the blocked list from the family website later.
What to watch
- The filter belongs to that family account, not to every login on the PC.
- Switching accounts each time is the annoying part of this control.
Browser extensions
Cold Turkey, StayFocusd, and LeechBlock NG
Cold Turkey, StayFocusd, and LeechBlock NG each live in the browser, so a second browser can walk past it.
Cold Turkey
Cold Turkey can block chosen websites plus desktop apps for a period you set. It can keep that block up for the whole period, which is stricter than a hosts line you can delete.
StayFocusd
StayFocusd is a Chrome extension that limits time on names you choose. StayFocusd also has a strict mode that blocks the chosen names for a block of time you start.
LeechBlock NG
LeechBlock NG is available for Chrome, Firefox, and Edge on this PC. Each LeechBlock set can follow its own schedule and its own time cap. You can keep more than one set, each with a different schedule.
What you get
- A schedule can turn the block on for part of the day only.
- You can aim at one page or at the whole name.
What to watch
- An extension can be turned off in the browser settings page.
- A second browser on the same PC skips an extension in the first one.
Banners, not websites
Do not disturb and Clock
Do not disturb quiets banners from the Notifications page in Settings. Press Win+I, open System, then open the Notifications page there. Turn on the switch labeled Do not disturb for the hours you care about.
The Clock app can pair its timed session with Do not disturb for those minutes. That timed session is labeled "Focus sessions" on the main Clock screen. Neither control stops a website from loading in any browser on this PC. More on that Clock timer is in the Windows session guide.
What you get
- Both controls ship with Windows, so there is nothing to install.
- The Clock session can quiet banners for a set number of minutes.
What to watch
- Neither control stops a website from loading in the browser.
- You can turn Do not disturb off again from Quick Settings with Win+A.
DNS
NextDNS and OpenDNS
DNS blocking answers the name lookup ahead of any browser connection. It covers browsers and many other programs that ask for that name.
NextDNS
- Create a free NextDNS account from the link in this section.
- Add each name in the NextDNS denylist, such as reddit.com or twitter.com.
- Open the Wi-Fi network page under Network and internet inside Settings.
- Edit DNS server assignment, choose Manual, and enter the NextDNS addresses from your account.
The account page is nextdns.io. The free NextDNS tier puts a cap on how many lookups you get.
OpenDNS
OpenDNS can block whole categories, such as social pages, instead of one name at a time. You still point Windows DNS at the addresses OpenDNS gives you.
What you get
- One DNS change covers every browser that uses that network setup.
- Changing the block means editing the denylist, not each browser.
What to watch
- A VPN, or a different DNS address, gets around this block too.
- The free NextDNS tier puts a cap on how many lookups you get.
LiquidFocus and the browser
LiquidFocus does not edit the hosts file, and it does not change your DNS. During a running work timer, the helper on 127.0.0.1 tells only the PeakFlow browser extension which names to block. You need that extension installed, or the helper has nobody to tell. The default names are the eight listed above. When the work timer ends, that block ends with it.
Breaks do not start by themselves unless you turn that option on. The block is tied to the work timer, not to the break. The 25-minute default, the 5-minute break, and the 15-minute long break after 4 runs are covered in the Pomodoro timer guide.
Read the dimming guide for FocusDim, a window tool rather than a website block.
Choosing among them
Use the hosts file for a free block you can undo in Notepad. Use LeechBlock NG for a schedule inside Chrome, Firefox, or Edge. Use Cold Turkey for a block that stays up for the period you set. Use NextDNS for a block that covers every browser without an extension. Use LiquidFocus for the default name list during one running work timer only.
You can put a DNS block under an extension, with the LiquidFocus timer on top. Do not disturb can sit beside all of them, quieting banners without touching the names.
The six tools in one installer
The free installer includes all six tools, with no time limit and no account. A 14-day Pro trial is included with that same download. LiquidFocus and FocusDim are two of the six tools in that installer.
Where to start
Start with the hosts file for the names that pull you off the task. Add an extension when you want a schedule the hosts file does not have. Add LiquidFocus when the block should exist only while a work timer is running.