Methods to Block Website for a User in Windows, Mac, Chrome

6 Ways to Block Website for a User in Windows, Mac, Chrome

With all the advantages and valuable features it offers, the Internet also comes with risks that we should always consider. Blocking a website for a user in Windows, Mac, and Chrome has various reasons; for example, Blocking websites can improve productivity and focus if you work remotely. Blocking video streaming sites, advertisements, unwanted pages, online games, and other websites that cause distractions during work and study can help you focus and browse faster.

Parents block inappropriate websites to protect their kids. On the other hand, blocking fraudulent or phishing websites protects users’ personal information and computers and prevents online activity tracking. Thus, blocking malware-laden websites safeguards your system, data, and privacy. In addition, blocking websites with high bandwidth and multimedia content helps you control data consumption and bandwidth utilization, so it will speed up browsing while saving you money.

As a result, blocking a website for a user is essential to promote productivity, security, and access to valuable online resources. This article will show you how to block a website for a user in Windows, Mac, and Chrome if you wish to block problematic sites for the reasons we mentioned.

How to Block Websites on Windows?

To browse safely in the Internet world, blocking inappropriate websites containing malicious content and malware is one of the valuable solutions. If, after buying a Windows VPS, you think of blocking a particular website to protect your system or for other purposes, don’t worry because Windows supports various methods of blocking sites, which are discussed in this article. There are different ways to block websites in Windows, such as editing system files, using third-party URL Disabler software, using built-in tools, and setting rules in Windows Defender Firewall.

In this guide, we will teach you some common methods to block dangerous websites in Windows. First, learn how to find the IP address of websites because you will need the IP address and domain name of the website you want to block.

Finding the IP address of the website on Windows

To block a website in Windows or any operating system through different methods, you need to know the site’s IP address and domain name, but how?

Type CMD in the Windows search box to launch the Command Prompt Administrator environment.

Then, use the nslookup command to find the IP address of the website you want:

For example:


IPv6 and IPv4 corresponding to the website are displayed in the output. Now, you can block access to the desired websites by using the website’s IP address and domain name using different methods we will teach later.

Method 1: Blocking the website in Windows by editing the Hosts File

One of the efficient ways to block a website in Windows without having to configure the browser is to use the Hosts File. Hosts File is a text file that contains IP addresses related to host names, which is used to map IP addresses to host names. As a result, by adding a website’s IP address to this file’s content, you can block access to a specific website. The process of blocking a website by editing the Hosts File is as follows:

  • Click on the Start menu (Windows logo) in the left corner of the screen and search for Notepad in the search bar. Right-click on Notepad and select the “Run as administrator” option to open Notepad using administrative privileges.
  • In Notepad, click the File tab and select the “open” option from the drop-down menu. Then Navigate to the C:\Windows\System32\drivers\etc path.

How to Block Website for a User in WIndows

How to Block Website in WIndows

  • Change the file filter to display from “Text Documents” to “All Files” and Open the Hosts File.

how to Block Website for a User in WIndows

 Blocking Website in WIndows by editing the Hosts File

  • Click on the last line at the end of the file to create a space and add the IP address and domain name of the website you want to block to the end of the file. for example:

ways to Block Website in WIndows

  • Go to File > Save and close Notepad after saving. Restart your browser or computer to apply the changes.

Note: To perform the above steps, you must have permission to access the Hosts File.

After completing the previous steps, open your browser and search for the URL of the blocked website in the browser’s address bar. If you receive the message “can’t reach this page” after searching for the URL of the blocked website, Make sure your desired website is blocked.

If you can access the website you want after searching for the website you blocked, Clear DNS Cache is the solution to this problem. For flushing the browser’s cache, you can use related advanced and popular tools.

To unblock the website, just open the Host File through Notepad and delete the IP address and domain name of your desired website from the file, then save the Host file and exit the file.

Method 2: Block website in Windows by setting rules in the firewall

If you use a firewall in Windows, you can prevent access to specific sites by setting rules based on website blocking. In Windows 10, Firewall Defender is one of the efficient tools to protect the computer against the damage of malware and harmful programs. Therefore, by using a firewall, you can block access to certain websites; for this purpose, follow the steps below:

  • Launch the control panel in the Windows system and select “Windows Defender Firewall.”

how to Block Website for a User in Windows through a Firewall

  • On the left side, select “Advanced Settings“.

Blocking the website in Windows using the firewall

  • Right-click “Outbound Rules” from the menu on the left side of the page and select “New Rule” among the options.

 Blocking Website in Windows

  • In the New Outbound Rule Wizard window, create a Custom Rule and then click Next.

how to Block Website for a User in Windows through a Firewall

  • In the new window, select “All programs” and click Next.

how to Block Website for a User in Windows through a Firewall


  • To answer the question of which Remote IP addresses this rule applies to, select “These IP addresses” and click “Add” to enter the IP addresses of the site you want to block; after entering the desired IP address, Click Next.

Blocking Website in Windows through a Firewall

  • Select the “Block the connection” option and then select Next.

 Blocking Website in Windows through a Firewall

  • In this window, you can choose whether the rule is applied to the domain, private or public, or all three cases. After selecting the right option for your needs, click Next.

how to Block Website for a User in Windows

  • Specify a name and description for the new rule you created, and finish the process of blocking the website through the firewall by selecting the “Finish” button.

how to Block Website for a User in Windows through a Firewall

Finally, by setting a new rule in Windows Defender Firewall, you prevented access to the site in Windows. To ensure that the website you want is blocked, you can search the domain name or URL of the website in your browser.

Method 3: Blocking the website in Windows using third-party software

Various third-party softwares are designed to block websites, including Cold Turkey, FocusMe, BlockSite, and URL Disabler. As a result, using these popular third-party softwares can prevent access to specific websites in Firefox, Chrome, etc. browsers. URL Disabler is one of the most popular free software to block the URL of websites; in the following, we will teach how to use URL Disabler to block the URL of websites in Windows:

  • Download URL Disabler by selecting Direct Download from its download page.
  • Press the Windows + E keys to access the Explorer file manager.
  • Find the folder containing UrlDisabler.ZIP and open the URL Disabler’s ZIP archive by double-clicking on it.
  • Select the “Extract all” option in File Explorer to decompress the file.

Blocking the website in Windows using third-party software

Blocking the website in Windows using URL Disabler

Note: If you don’t find the “Extract All” option, click the Browse button, select the directory you want to extract, and click the Select Folder” option. Finally, choose Extract All.

  • In the extracted URL Disabler folder, double-click UrlDisabler_x64.exe and enter the URL Address of the desired website to block in the text box.

how to block website in windows using URL Disabler

  • Select the + sign to add the website URL to this software.

how to block website in windows using URL Disabler

  • Click the tick icon to save your changes.

To ensure your changes are applied, search the website URL you blocked in the browser. If you get the blocked error message for the site, make sure your changes are applied.

To unblock websites, open the URL disabler software, remove the websites from the list, and save your changes.

Method 4: Block websites in Windows through Windows Parental Controls

If you manage multiple user accounts in Windows, you can apply restrictions to specific user accounts using Windows Parental Controls. For this purpose, follow the steps below:

  • Press the Windows button on the keyboard and type “Family settings” or “Parental controls” in the search bar.
  • After accessing the relevant settings, select the user account for which you intend to block specific websites.
  • By selecting the “Web browsing” section, you can apply restrictions to the selected user account and block certain websites through this section of the Parental controls settings.

Blocking websites on Mac

All operating systems support a method to block websites. In Mac, as in Windows, there are various methods, such as editing the Hosts File, built-in tools, browser extensions, third-party software, etc., to block the website. The easiest way is to edit the Hosts File to block specific websites on Mac; follow the instructions below to block your desired website on Mac:

1. Access the Terminal

To open the Mac Terminal program, go to the Applications > Utilities folder or search for the Mac Terminal program through Spotlight. By clicking on the magnifying glass icon on the upper-right side of your Mac’s screen, a text box will be displayed where you can type Terminal. When the Mac Terminal option appears, open it by double-clicking it to access the Mac Terminal program.

The easiest way to open the Mac Terminal is to press Command + Space and type Terminal in the text box that appears.

2. Open the Hosts File

To edit the Hosts File, open it in the Text editor. For this purpose, type the following Command in the Terminal:

sudo nano /etc/hosts

3. Enter the administrator password

You may be prompted for the Mac administrator password, so enter the password you use to log into your Mac and click “Return” to have the privilege to edit the Host File, and the Host File will open.

4. Add the URL of the site you want to block to the Host File

Navigate to the end of the file using the keyboard arrow keys and add the URL of the website you want to block in the browser to the end of the file, as in the following example:

As you can see, at first, you don’t need to type WWW to specify the URL of the website you want, and in the following line, add “http://” or “https://” part of the website address.

Note: If you have access to the IP address of the desired website, you can block the desired website by adding the IP address of the website to the Block list in the Host File. To block the mobile site, just type “m” in front of the site address as in the example below and block the mobile version of the website as well:   "m."

5. Save the Host File and exit the text editor

To apply the changes, save the HostFile by pressing Control + O and exit the text editor by pressing Control + X.

6. Flush the DNS cache

To apply the changes, it is recommended to clear the DNS cache from the previous information and data of the website (passwords stored on the desired website). To flush the DNS Cache on Mac, run the following commands:

sudo dscacheutil -flushcache


sudo killall -HUP mDNSResponder

Then Restart your system. Congratulations, you have successfully blocked your desired website on Mac.

Block websites in Chrome

Various extensions are designed to block websites in Chrome, so you can block websites in the browser by installing website-blocking extensions in Chrome. You can enter the Chrome web store by opening the Google Chrome browser and typing “Chrome web store” in the address bar and pressing Enter, and by typing “website blocker” or “block site” in the Chrome Web Store search bar, you can choose various extensions to use. One of the most popular and best extensions for blocking websites and individual pages in Chrome is the Block Site extension, which will teach you how to block websites through this extension in the Chrome browser:

1. Launch the Google Chrome browser, go to the Block Site page, and click the Add to Chrome option. A pop-up will appear asking for confirmation to add the extension. Click “Add Extension.”

Blocking websites in Chrome

2. After installing the block site extension, an icon will appear in the upper right corner of the browser next to the address bar. Click on the Block Site icon.

3. Choose “Edit block sites list” from the drop-down menu or click on the gear-shaped icon on the Block Site page. By launching the Block site page and following the instructions, you can add the desired websites to the block list of this extension.

4. By selecting the “+ Add to Block List” option, enter the URL of the desired website and block the desired website.

Blocking websites in Chrome

Note: You can go to the website you want to block and copy the website address by pressing Ctrl+C on Windows and Command+C on Mac and entering it in the Block site extension. Also, by going to the website page, you can click on the block site icon and be asked if you want to block the website you are on or not. By confirming the request, you can block your desired website.

If you want your set Block list to be safe from other people’s access and unwanted changes, set a password for the Block Site extension. For this purpose, select the “Password protection” option on the left side of the Block Site page and set a security password consisting of 5 characters to protect the Block List set in the Block Site extension.

Blocking websites in Chrome

Therefore, to add or delete website addresses in the Block site extension, you must enter the set password before entering the Block site page. If you forget your password, right-click on the Block site icon and click Remove from Chrome.

Click the trash can symbol next to the blocked items to unblock the website in the block site extension.

After configuring the settings, the extension will prevent access to blocked websites. This extension is used in most browsers like Firefox and Microsoft Edge.


The "hosts" file on Mac is located at /etc/hosts.

Although the methods introduced in this article effectively block websites, determined users can find ways to bypass the restrictions.

Yes, you can set temporary blocks using several blocking methods on both Windows and Mac.


In this article, you learned how to block inappropriate and malicious websites on Windows, Mac, and Chrome browsers. There are various methods to block the website in Windows and Mac, such as editing the HostFile, third-party tools, and setting rules in the Windows Defender firewall, etc.; the simplest and most common way is to edit the Host File. In the Chrome browser, you can prevent access to the website by adding the popular Block site extension.

Another way to filter content for children is the Family Safety section in your Microsoft account, which blocks adult websites for your children. In addition, from the Family Safety section, you can apply a time limit for browsing certain websites or accessing specific programs.

We hope to see improvements on Windows and Mac soon, such as implementing the website blocking feature without going through the steps in this article. Have you experienced any other efficient and fast way to block websites on Windows or Mac? We would like to know your suggested method.

Leave a Reply

Your email address will not be published. Required fields are marked.