Situatie
We’ve all been there. You’re sitting at your desk at work, fiddling with some spreadsheets or documents online when you get a sudden urge to take a peek at Facebook. A harmless mistake, sure. But you’re not feeling so productive once an hour rolls by, and you’ve gotten absolutely nothing done. That’s a problem.
And what about those kids of yours? Staying up all night perusing Facebook, YouTube, and whatever else certainly might not be conducive to a healthy lifestyle.
The good news is there are plenty of ways to block access to certain time-consuming or explicit websites, whether you want to restrict access altogether or only during specified hours of the day.
Solutie
Pasi de urmat
Using parental controls in MacOS
Windows isn’t the only operating system that allows you to monitor your child’s activities online. You can use the Parental Controls feature in MacOS to block websites, which is particularly helpful if you want to keep your kids off of certain websites, without restricting the access of other users.
Step 1: Open System Preferences and click the button labeled Parental Controls.
Step 2: Your Mac will ask if you want to Create a new profile with parental controls, or add them to your current profile. Assuming you want to block websites for when your kids use the computer — while keeping them open for you — select Create a new user account with parental controls.
Step 3: If your current profile is password-protected, you will need to enter your password. Once you’ve created the profile, select it in Parental Controls and click the Web tab.
Step 4: If you’re feeling particularly draconian, you can also allow access to only specific websites. If not, simply click the Customize button.
In the resulting pop-up window, there will be a section to add websites that are always allowed, and a lower section for websites that are never allowed.
Step 5: To add a website that you want to block, click the addition sign under the Never allow heading and enter the address of the site you want to block. Now, enter as many websites as you want to block, one per line.
Step 6: When you’re finished, click OK in the bottom-right corner.
Using MacOS hosts file
Blocking websites using MacOS works in a similar fashion to blocking them using Windows. The process is free, relatively quick, and requires altering your Mac’s hosts file to redirect a specified domain name. It’s a simple process that will prevent users from seeing content you deem block-worthy across browsers, but one that can be reversed if you want to grant access to the sites in the future.
Step 1: Launch Terminal by accessing the main applications folder, clicking Utilities, and selecting the program from the resulting list. You can also do so by searching for the program in Spotlight.
Step 2: Now it’s time to make a copy of the hosts file just in case something goes awry. Type sudo /bin/cp /etc/hosts /etc/hosts-original on the Terminal command line to make a backup of the file in question. Hit Enter and type in your administrative password when prompted. It may appear as though the keystrokes aren’t being registered properly — i.e., your cursor won’t move — but rest assured that they are.
Step 3: Type sudo nano /etc/hosts and hit Enter on the Terminal command line to open up your hosts file in a nano box. Then, enter your administrative password when prompted.
Step 4: Once the hosts file is opened, you will see several lines of text used for mapping purposes. Underneath the last line of text — it should say something regarding a local host — enter 127.0.0.1 and press the spacebar. Next, type the IP address of the website you want to block on the same line. For example, type 127.0.0.1 www.youtube.com to block all traffic from the popular video-sharing site.
Step 5: Continue to add websites you wish to block in this manner, each beginning with 127.0.0.1. followed by a space and the appropriate website. Make sure to only use www and avoid adding http, unless you want to render the entry invalid, and do not alter any other text in the hosts file.
Step 6: When finished, hold down the Control key and press O to save the changes. Then, hold down the Control key and press X to exit the hosts file.
Step 7: Next, type sudo dscacheutil -flushcache and press Enter again to flush your existing cache and put the changes into effect. Alternatively, you can restart your computer.
Once you’re back up and running, open your favorite browser and test the results! You should automatically get a blank page whenever you attempt to access any of the sites on your blocked list.
Leave A Comment?