Blocking a website, regardless of your reasons, is simpler than you might imagine. Although it involves using a few lines of code, the process primarily consists of copying and pasting. All major internet browsers allow you to block individual websites with ease. Ensure you fully understand the instructions before proceeding.
Note: You need administrative privileges to make the following changes. This means you must be the primary user of the computer and know the password.
Steps
Block Websites on Windows

Open My Computer and locate the "C:" drive. To block websites on any browser, you need to access and modify the "HOSTS" file. This file allows you to translate URLs, such as www.google.com, into numerical DNS addresses. With a few adjustments, you can use this translation feature to block your computer from accessing specific websites.
- If you don’t see the "Windows" folder in the C: drive, check other drives. While Windows is typically installed on the C: drive, it might be on a different drive if you installed it manually.

Locate the "etc" folder on your drive. Navigate to Windows –> System32 –> drivers –> etc. Inside the etc folder, find the "Hosts" file.
- The path you’re aiming for is C:\WINDOWS\system32\drivers\etc. You can enter this path directly into the address bar in My Computer if you can’t find the etc folder.
- Alternatively, you can search by typing "notepad C:/Windows/System32/drivers/etc/hosts" in the Command Prompt. To use Command Prompt, find and open the program from the Start menu.

Open the "hosts" file with Notepad. Double-click the Hosts file and choose to open it with Notepad. This allows you to edit the file and block specific websites.
- If the option to open with Notepad doesn’t appear, launch Notepad manually. Then, click on "File" → "Open" in Notepad and locate the Hosts file as described earlier. Click on the file to open it.

Scroll down to the empty space at the end of the file. You’ll see various lines of code and text, but you don’t need to modify them. Scroll to the bottom and find the line "127.0.0.1 localhost".
- Do not edit or alter anything else. This file is crucial for internet connectivity, and you only need to add a few lines at the end to block websites.

Press enter to create a new line at the end of the file. Start the new line directly below the "localhost" line.

Block a website by entering its URL after "127.0.0.1". At the beginning of the line, type 127.0.0.1, press the spacebar, and then type the website’s URL. For example, to block Google, type "127.0.0.1 www.google.com".
- Do not add "http://" before the URL, as this will prevent the website from being blocked.

Add other websites to block on separate lines. If you want to block multiple websites, simply press "enter" to create a new line. Type 127.0.0.1 followed by the website’s URL. This method allows you to block an unlimited number of sites.

Save the file. After blocking the websites, click on "File" → "Save". Close your browser if it’s open, then reopen it. The websites will now be blocked across all browsers.
Block Websites on Mac

Open Terminal. This is the program that allows you to make administrative changes on a Mac. Use the search bar or navigate to Finder /Applications/Utilities/Terminal.
- Terminal has a black window with white text. It enables you to execute commands on your computer.

the current host file as a backup in case of accidental edits. While changes are minimal, it’s best to have a backup. To do this automatically, type the command “sudo /bin/cp /etc/hosts /etc/hosts-original” into the Command Line and press "enter".
- You may be prompted to enter the administrator password. This is the password you use to log in to your computer.

Open the hosts file. Type “sudo nano /etc/hosts” and press "enter" to open the "hosts" file in a new window. This is the file you need to edit to block websites. Scroll down, skipping the last line (usually a phrase associated with "localhost").

Start a new line with 127.0.0.1. This line informs the computer which website to block. Type the number sequence and press the spacebar.

Add the website you want to block after the number. Enter the website’s URL after the space, starting with www. For example, to block Google, type "127.0.0.1 www.google.com". Remember to place each entry on a separate line.
- Do not add "http://" before the URL.

Add other websites on separate lines. To include additional sites, press enter, then type 127.0.0.1, followed by a space and the website’s URL. The computer will block these websites across all browsers.

Save the file. Press the Control Key + "O" (the letter O, not the number 0) to save the file, then close the window. The changes will take effect immediately.

Reset the cache to apply changes. In Terminal, type “sudo dscacheutil -flushcache” and press "enter". This clears the cache, allowing your changes to take effect. Open your browser to check if the changes have been applied.
- If not, review the Host file again to ensure your changes are at the bottom, on separate lines, and formatted correctly.
- If it still doesn’t work, restart your computer and reload the page. The website should now be blocked.
Block Websites on Individual Browsers
Internet Explorer

Open Internet Explorer. Internet Explorer (IE), Microsoft’s browser, allows you to block websites with minimal effort. However, these changes won’t affect other browsers, such as Firefox.

In the top menu, click on Tools > Internet Options. A settings window will appear, enabling you to adjust which sites to block. There are multiple tabs at the top of the window where you can modify settings.
- On newer versions of IE, you’ll see a gear icon instead of "tools". Click the gear, then select "Security Settings".

Click on the Privacy tab, then click on "sites." Enter the address of the website you want to block and click OK. This method allows you to block only one website at a time.
- On newer versions of IE, you need to click on "Restricted Sites" > "Sites".

Use a Microsoft account to block specific websites on the newer IE browser, also known as Edge. To block websites on the revamped and renamed Internet Explorer browser, now called "Edge," you need a Microsoft account. This allows you to adjust online settings to block any website directly from your account.
- To do this, visit https://account.microsoft.com/family/about?refd=windows.microsoft.com
Mozilla Firefox or Google Chrome

Open your web browser. Firefox and Chrome don’t have built-in website blocking features, but you can download free plug-ins to simplify the process.
- On Chrome, visit the Chrome Web Store. On Firefox, these tools are called "Add-ons".

Access the add-ons you need. In Firefox, click on the three gray horizontal lines in the top-right corner and select "Add-Ons" to access parental controls or website blocking options. On Chrome, click the "Apps" button in the top-left corner, then select "Web Store".

Find and download the appropriate plug-in. Mozilla offers a convenient page featuring the best website blockers and parental controls here. For basic website blocking, you can choose "BlockSite".
- If you’re looking for more robust programs, search for "parental controls or filters" on the online store or add-on library. These programs include advanced controls to block specific types of websites, similar to web blacklists.
- Once downloaded, the plug-in will activate and prompt you to specify which sites to block.
- If you can’t find the plug-in, click the three horizontal lines in the corner and select "Add-ons" (Firefox) or "Extensions" (Chrome).
Safari

Open Safari and click on the Apple icon in the top-right corner of the screen. This will bring up settings and options. Safari doesn’t block websites outright but allows you to restrict access to specific sites more tightly.

Select System Preferences and look for Parental Controls. This feature enables you to block websites and set up a "parental account" to monitor and control what others can access on Safari.

Click on "Convert this account to a parental controls account." This action requires you to enter the administrator password—the one used to log into your computer at startup. After entering the password, the Parental Controls window will appear.

Click on "Web" > "Allow access to only these websites." This action activates Safari’s restriction feature. You can add sites using the "+" button and "Add Bookmarks".
- To regain full control, simply uncheck "allow access to only these websites".
Steps
- Parental control software available online can automatically block websites based on categories, such as gaming or adult content.