If you are one of those who spend a lot of time working in front of the computer, you know how difficult it is to manage yourself in order to always be productive while being just one click away from the many possible distractions. But don't give up: blocking access to a particular website is in fact a simple and fast process, useful to keep your productivity level always high. Read on to find out how to prevent access to a website on Mac.
Steps
Method 1 of 4: Block a Website on Mac OS X
Step 1. Start your computer
Press the power button on your Mac and wait for the machine to complete the boot process and be ready to use. This operation could take a time varying between a few seconds and a few minutes. Remember that, to block access to a particular website on Mac, you need to edit the contents of the hosts file. Within this file, the websites visited can be mapped, which allows the identification of the computer by other communication devices, including for example the internet network. Basically, what you will need to do is indicate in the hosts file to redirect requests to a particular website, so that it stops being reachable. This method is a bit technical, so pay close attention..
- Go to the "Applications" folder.
- Select the "Utilities" folder.
-
Choose the "Terminal" icon to start the relevant program.
Alternatively, you can search via the "Spotlight" function using the keyword "Terminal" (without quotes)
Step 2. Save a copy of the original hosts file
Given the technicality of this method, things may not go as you hope, so the decision to create a backup copy of the original file is certainly valid. To do so, follow these simple steps:
- Inside the "Terminal" window, type the following command: "sudo nano / etc / hosts" (without quotes).
- When finished, press the "Enter" key. This way the contents of the hosts file will be displayed using the "nano" editor.
-
When prompted, enter the password of a computer administrator user.
For security reasons, when you enter the password it will seem that the letters and symbols entered are not registered by the system because the cursor on the screen will remain motionless. Don't worry, everything works normally, so make sure you enter your password correctly
Step 3. Block access to the sites in question
After opening the hosts file, you will see several lines of text appear on the screen.
- After the last line in the file, enter the following IP address: "127.0.0.1".
- Press the space bar.
- Enter the URL of the website you want to block. For example "127.0.0.1 www.facebook.com".
Step 4. Add the other sites you want to block access to
Using this method you can block many other URLs. However, remember not to use the "http" prefix and to directly enter the URLs with the words "www".
Step 5. Complete your work
At the end of the compilation of the list, proceed with the next steps to complete the procedure.
- To save the changes to the hosts file, press the key combination "Ctrl + O".
- To close the editor with which you edited the file, press the key combination "Ctrl + X".
Step 6. Clear the cache
The cache is an area of memory where recent information is stored for quicker access. Normally this is not something you need to worry about, as it is handled in the background in a totally transparent way for the user. However, for changes to the hosts file to take effect, you must clear the information currently stored in the computer cache.
To do this, type the following command in the "Terminal" window: "sudo dscacheutil -flushcache" (without quotes)
Step 7. Verify the changes via your internet browser
The time has come to test your work. To do this, simply open Safari and try to access one of the blocked sites. If you have made the changes correctly, the screen will remain blank, or alternatively an error message will appear.
Method 2 of 4: Block a Website Through the Router
Step 1. Log into your router's web interface
The router is a network device designed to allow connected devices to access the internet. In a home network, this will often be a Wi-Fi router that allows devices to connect wirelessly to simplify access and use of the network. Depending on the model and brand of your router, you may need to use a specific IP address to access the device's web interface. Most routers on the market use the same IP address. This method can also be a bit technical, so pay close attention..
-
In the address bar of your browser, type the address "192.168.1.1" (without quotes). If this IP address does not give access to the device's web interface, try using one of the following alternate addresses: 192.168.0.1 or 192.168.2.1.
If you need further help finding out how to access your network router's web interface, check out these sites: "www.routerpasswords.com", "www.cirt.net"
- When prompted, enter your login username and password.
Step 2. Access the security section of the router's web interface
This section may be labeled "Security", "Security" or something similar. In any case, locate and access the section that allows you to manage and control internet access from the local network. It is usually identified with the words "Content Filtering" or "Access Restrictions".
Step 3. Block access to sites of interest to you
Once you've found the correct section, you can start entering the URLs of the websites you want to block access to.
When you have finished entering, press the "Save" or "Apply" button to save the new configuration
Method 3 of 4: Block a Website Through Application
Step 1. Download Selfcontrol
There are many applications that allow you to block access to a particular website. Selfcontrol is a program designed specifically for Mac OS X and is probably one of the simplest to use. The application provides a list in which you can enter all the websites you want to block.
Step 2. Launch the application
Select its icon as you would for any other program.
A simple window will appear, consisting of three essential elements
Step 3. Start entering the list of websites to block
- Press the "Edit blacklist" button.
- Press the "+" button and add all the URLs of the sites you want to block access to.
- Configure the program timer to prevent access to the websites in question while you are focused on your work.
- Press the "Start" button and dedicate yourself to your activities until the timer reaches 0.
Method 4 of 4: Block a Website Using Safari
Step 1. Use your Mac's "Parental Controls" feature
This is a feature built into the operating system (the software that ensures that your computer works). Of those listed in this guide, this method should be the simplest and require the least technical knowledge, while being equally effective.
- Access the "Apple" menu and select "System Preferences".
- Select the lock icon in the lower left corner of the window that appears. Type the password of the computer administrator user.
-
Select the "Guest User" item on the left side of the window.
Note that you will not be able to configure the "Parental Controls" feature for the computer administrator user (ie your user). In fact, the system administrator user will not appear in the list of available profiles
Step 2. Determine which websites you want to block
From the "Censorship Controls" window you can select several tabs: "App", "Web", "People", "Time" and "Other".
- Select the "Web" tab. You will be given three options for access control: "Allow free access to websites", "Try to automatically restrict access to adult websites" and "Allow access to only these websites". The last option provides the "Customize" button and is probably the most flexible and suited to your needs.
- Press the "Customize" button. A new window will appear divided into two sections: "Always allow these sites:" and "Never allow these sites:".
-
Press the "+" button relative to the "Never allow these sites:" box located in the lower left part of the window. Then simply type in the URL of the website you want to block. For example "www.facebook.com" (without quotes).
You can also use the "Always allow these sites:" box; however, this option could be too restrictive, effectively blocking access to all websites, except those listed
- At the end of the insertion press the "OK" button in the lower right part of the window.
Step 3. Verify that everything is working properly
Inside the Safari address bar, type the URL of one of the sites you have blocked access to. The page should remain blank, or alternatively a notification message may appear regarding the restriction of access to the web.