How to Block Unblock Website on Mac Terminal?
Mark Briggs | June 6th, 2022 | Mac OS X
You will understand how to block or unblock a website on a Mac terminal in this section. You may go one step higher by simply preventing your computer from visiting some websites altogether. The majority of online browsers are equipped with plugins that can assist you in remaining productive and preventing you from opening websites on which you are spending time.
There are a variety of methods available for blocking websites on a Mac, including the built-in function of Parental Control, third-party applications that are specifically designed to block websites and applications, and altering the host’s files on your Mac. However, the use of Terminal is by far the simplest method for blocking websites on a Mac.
One can want to block a website for different reasons. It may be attempting to deliver you malware or unwanted messages. Or if the PC is used by youngsters then you may block some pornographic material or ultra-violent media to guarantee that they are not harmed by it when simply skimming over the internet. While no form of the material may be prevented 100 percent you can always the key websites and attempt to control the use of your PC.
Therefore, in this section, we will demonstrate the most effective method for blocking websites on a Mac by utilizing Terminal.
How to Block Websites on Mac using a Terminal?
To block or unblock a website on the Mac terminal process, admin login details are must important. All the steps are given below:
- Open the terminal on your Mac system.
- Now enter the command to open the host’s file:
sudo nano /etc/hosts
- Here you have to enter the login details of the admin account.
- Find the line “127.0.0.1 Localhost” in the editor.
- Now type this command:
127.0.0.1 <TAB> <website url>
Example: 127.0.0.1 www.facebook.com
- Now press CTRL + O to save the changes and return from the terminal.
Now open your browser and search the blocked website to recheck whether that site is blocked or not.
Now you can see the whole process to block websites on Mac using the terminal. After that, we will show you how to unblock websites on Mac using the terminal. The complete procedure is mentioned below:
How to Unblock Websites on Mac Terminal?
- Firstly, Open the terminal on your Mac system.
- Now type the command to open the host file:
sudo nano /etc/hosts
- And the screen will open and enter the admin login details here.
- Now find the blocked websites here.
- After that, use the # icon in Infront of blocked sites, as you can see below:
- Lastly hit the CONTROL + O to save the changes and then open the website on your web browser.
Time to Say Goodbye
Finally, as you may notice from the instructions that were provided above block unblock websites on a Mac terminal is an easy process that takes little time. Above, you get the complete and detailed knowledge to block or unblock the websites.