Close Menu
Must Have Gadgets –

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    India will no longer require smartphone makers to preinstall its state-run ‘cybersecurity’ app

    December 3, 2025

    MSI Cubi NUC AI+ 2MG mini PC review

    December 3, 2025

    Android’s in-call scam protection goes live in the US to stop screen-sharing fraud

    December 3, 2025
    Facebook X (Twitter) Instagram
    Must Have Gadgets –
    Trending
    • India will no longer require smartphone makers to preinstall its state-run ‘cybersecurity’ app
    • MSI Cubi NUC AI+ 2MG mini PC review
    • Android’s in-call scam protection goes live in the US to stop screen-sharing fraud
    • 114 Cyber Monday Deals Still Available Today on Apple, Nintendo, TCL, Samsung and More
    • Which phones support aptX Lossless?
    • I’ve been testing cooling mattress and sleep products all year — these are the 12 best gifts to buy a hot sleeper
    • AWS doubles down on custom LLMs with features meant to simplify model creation
    • Character.ai launches Stories to keep teens engaged as it scales back open-ended chat for under-18s
    • Home
    • Shop
      • Earbuds & Headphones
      • Smartwatches
      • Mobile Accessories
      • Smart Home Devices
      • Laptops & Tablets
    • Gadget Reviews
    • How-To Guides
    • Mobile Accessories
    • Smart Devices
    • More
      • Top Deals
      • Smart Home
      • Tech News
      • Trending Tech
    Facebook X (Twitter) Instagram
    Must Have Gadgets –
    Home»How-To Guides»How to Edit the hosts File on Windows 10 or 11
    How-To Guides

    How to Edit the hosts File on Windows 10 or 11

    adminBy adminOctober 21, 2025No Comments5 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    How to Edit the hosts File on Windows 10 or 11
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Summary

    • The hosts file is the first place Windows checks for IP addresses when connecting to websites and can be manually edited to block access to specific websites.
    • The hosts file is located in “C:\Windows\system32\drivers\etc” on both Windows 10 and 11, and you need administrative permissions to edit it.
    • To block a website with the hosts file, direct the URL to either 0.0.0.0 or 192.168.0.1.

    The hosts file is the first place Windows checks when connecting to a website. You can edit it manually to block access to specific websites. Find out what and where it is, and how to edit it.

    What Does the hosts File Do?

    When you type in a regular web address to access a website, like google.com, your PC doesn’t automatically know how to connect. It needs the correct IP address associated with the web address in order to make a connection.

    The hosts file is the first place your PC will check to find an IP address for a website, but by default, the hosts file doesn’t contain any. If your PC can’t find an IP address in the hosts file, it checks the DNS cache or connects to a DNS server. When a web address and an IP are inserted into the hosts file, it will provide that information to your computer any time you try to connect to that web address.

    If the hosts file tells your computer to find a web address at an IP address that won’t connect—like 0.0.0.0—it blocks access to the website.

    Related

    How to Edit Your Hosts File on Windows, Mac, or Linux

    Editing the hosts file is a harmless way to prank your friends.

    The Windows hosts File Location

    The hosts file is located in “C:\Windows\system32\drivers\etc” on both Windows 10 and 11. You need administrative permissions to edit it, which means that you can’t just open it in a normal Notepad window.

    How to Edit the Windows hosts File

    You can edit the hosts file with any text editor. There are a variety available, but both Windows 10 and 11 come with Notepad, and I’d recommend sticking to that. Avoid using a word processor—the differences between Notepad and a word processor like Microsoft Word can sometimes cause problems.

    You’ll need to run Notepad as administrator to edit the hosts file. To do this on Windows 11 (or Windows 10), click on the start button, and then type notepad into the search bar. On the right-hand side, click “Run as administrator.”

    Once Notepad is open, click on File > Open, and navigate to “C:\Windows\System32\drivers\etc”

    Notepad is set to look for TXT files by default, so you’ll need to set it to look for “All Files” in the drop-down menu instead. Then, click the hosts file and hit open.

    Once the hosts file is open, you can start adding lines to block websites. The lines that go into the hosts file can be broken up into three basic components, each separated by at least one space.

    Number

    Component

    Description

    1 (Green)

    The IP Address

    This tells your PC where to look for a website.

    2 (Blue)

    The Web Address

    This is the website address you want to block.

    3 (Purple)

    The Comment

    Where you describe what the line does. The comment must have a hashtag preceding it.

    It isn’t necessary to include the comment for the hosts file to work, but commenting files when you edit them is an excellent habit.

    Once you’re done adding lines, click File > Save to save your changes. There shouldn’t be a popup after you click save. If there is, it means Notepad does not have administrative access, and that you need to close Notepad and run it as administrator. Once you’ve saved successfully, go ahead and exit Notepad.

    There are two addresses, 127.0.0.1 and 0.0.0.0, that are commonly used in the hosts file to block traffic. There are significant differences between 127.0.0.1 and 0.0.0.0, but in most cases either will work. Rarely, a program running on your PC might have problems if you use 127.0.0.1, so it is best to stick with 0.0.0.0.

    If You Can Still Connect to Blocked Addresses

    Recent versions of Google Chrome, Mozilla Firefox, and Microsoft Edge all use DNS over HTTPS (DoH) by default. DNS over HTTPS works the same way as a regular DNS server, however DNS over HTTPS encrypts your queries to boost your privacy. Encrypting your queries means that third parties can’t tell what requests you’ve sent to a DNS server, or how the server responds.

    When DNS over HTTPS is enabled in a browser, the browser bypasses the normal DNS client in Windows 10 and 11. That means the browser ignores the hosts file entirely and uses a secured DNS server specified by the browser instead, so any addresses you attempt to block using the hosts file will be accessible. If you want to use the hosts file to block web browser traffic, you’ll need to disable DNS over HTTPS in your browser.

    Fortunately, you can enable DNS over HTTPS on Windows 11. That will allow you to use the hosts file to block addresses while maintaining the advantages of DNS over HTTPS.

    Edit File hosts Windows
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    admin
    • Website

    Related Posts

    Android’s in-call scam protection goes live in the US to stop screen-sharing fraud

    December 3, 2025

    Record players are seeing a resurgence in Gen-Z, but not for the reason you might think

    December 3, 2025

    New Windows 11 ‘PC you can talk to’ ad pushing Copilot is proving divisive – and I can see it seriously backfiring

    December 3, 2025
    Leave A Reply Cancel Reply

    Top Posts

    India will no longer require smartphone makers to preinstall its state-run ‘cybersecurity’ app

    December 3, 2025

    PayPal’s blockchain partner accidentally minted $300 trillion in stablecoins

    October 16, 2025

    The best AirPods deals for October 2025

    October 16, 2025
    Stay In Touch
    • Facebook
    • YouTube
    • TikTok
    • WhatsApp
    • Twitter
    • Instagram
    Latest Reviews
    How-To Guides

    How to Disable Some or All AI Features on your Samsung Galaxy Phone

    By adminOctober 16, 20250
    Gadget Reviews

    PayPal’s blockchain partner accidentally minted $300 trillion in stablecoins

    By adminOctober 16, 20250
    Smart Devices

    The best AirPods deals for October 2025

    By adminOctober 16, 20250

    Subscribe to Updates

    Get the latest tech news from FooBar about tech, design and biz.

    Latest Post

    India will no longer require smartphone makers to preinstall its state-run ‘cybersecurity’ app

    December 3, 2025

    MSI Cubi NUC AI+ 2MG mini PC review

    December 3, 2025

    Android’s in-call scam protection goes live in the US to stop screen-sharing fraud

    December 3, 2025
    Recent Posts
    • India will no longer require smartphone makers to preinstall its state-run ‘cybersecurity’ app
    • MSI Cubi NUC AI+ 2MG mini PC review
    • Android’s in-call scam protection goes live in the US to stop screen-sharing fraud
    • 114 Cyber Monday Deals Still Available Today on Apple, Nintendo, TCL, Samsung and More
    • Which phones support aptX Lossless?

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    Facebook
    • About Us
    • Contact Us
    • Privacy Policy
    • Terms and Conditions
    • Disclaimer
    © 2025 must-have-gadgets.

    Type above and press Enter to search. Press Esc to cancel.