How to block a website

Who needs the whole internet at their fingertips? Here's how to block some of it

how to block a website image
kmiragaya/123RF

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.

Method #1: Using parental controls

Both Windows and MacOS have built-in parental controls that you can use, making it easy to block what you don’t want to be accessible on your system. If you find that you want more features, we’ve outlined the best free parental control software here.

Parental Controls in Windows 10

Step 1: You must first set up a child account. To do so, go to the Windows 10 settings menu by searching for it, or clicking the cog icon in the Start menu.

Step 2: Click “Accounts.”

Step 3: Click on the “Family & other people tab” and click the button labeled “Add a family member.”

Step 4: Click “Add a child” and enter the required information to set up your child’s profile.

Step 5: Go to your Microsoft account page. Select the “Web browsing” tab and check the box labeled “Only see websites on the allowed list.”

Step 6: Here, you will see sections for “Always allow these and “Always block these.” Enter URLs for any sites you want to block in the appropriate section, and click the “Block” button to the right.

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.

Method #2: Altering host files

Block using Windows hosts file

Blocking specific websites in Windows is child’s play — and usually child-proof. It’s completely free, doesn’t require any additional software, and just takes a few quick alterations to the Windows hosts file on your computer. The hosts file, a plain text file your operating system utilizes for mapping IP addresses and hostnames, can be used to redirect a domain name back to the local computer, essentially blocking the desired website. It’s a great way to restrict users from seeing content you don’t want them to see, regardless the browser and the time of day.

Keep in mind, however, that you must have administrator privileges in order to change the file and it can be a little technical. You can always undo the change if need be, but the process is a little more hands-on than the Windows/MacOS parental controls.

Step 1: Using Windows Explorer, navigate through to the “hosts” file by going through: C: > Windows > System32 > drivers > etc.

how to block a website hosts01
Step 2: Double-click “hosts” and select Notepad when prompted to choose a program to open the file with. Alternatively, you can launch Notepad and navigate to the host file by choosing File > Open, and locating the file through that window.

how to block a website hosts02
Step 3: In Notepad, 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.

how to block a website hosts03

Step 4: 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. Do not alter any other text in the hosts file.

Step 5: Once you’ve added the sites you want to block, click the “File” option in the upper-left corner, choose “Save” do not change the name or save location — and ignore any warnings regarding editing the hosts file. Then, close Notepad when finished.

Step 6: 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. You may have to restart your browser and wait several minutes for the changes to take effect.

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.

how to block a website terminal 23

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.

how to block a website terminal 23

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.

how to block a website terminal2

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.

Method #3: Using your router settings

Blocking all users, at all times, on all browsers can take some time using the above methods. Fortunately, your router doesn’t require any external software and is another fantastic tool that will grant you network-wide control over the blocking process. Although we cannot guarantee your router is capable of blocking specified websites, most routers are equipped with some sort of parental controls for restricting website access completely, during certain days of the week, or even during defined hours.

Step 1: Open your router’s web interface. Most routers can be accessed by entering “192.168.1.1” in your browser’s address bar and typing in a username and password. The defaults do vary from router to router, however, so be sure to check the instructional manual included with your router for the default IP address, username, and password. If unavailable, try looking up the router’s defaults at routerpasswords.com, or cirt.net.

Step 2: Navigate to the router security panel or tab that features the blocking controls. The security options are typically housed under something like “Access Restrictions” or “Content Filtering.”

Step 3: Once you’ve discovered the correct location, enter the websites you want to block and any other content restrictions you want to put in place. Save and apply the new settings when finished.

Movies & TV

The best movies on Amazon Prime right now (December 2018)

Prime Video provides subscribers with access to a host of fantastic films, but sorting through the catalog can be an undertaking. Luckily, we've done the work for you. Here are the best movies on Amazon Prime Video right now.
Smart Home

Never crawl under the tree again! Alexa, turn on the Christmas tree lights

Did you know you can make your Christmas tree smart, just like many of the other electronics and gadgets in your home? You can even create routines involving your tree. Here’s how to make a smart Christmas tree this holiday season.
Computing

Change your mouse cursor in Windows with these quick tips

The standard mouse cursor is boring, so change it! With this guide on how to change your mouse cursor in Windows, you can choose to use one of Microsoft's pre-installed cursors or download something a bit more extravagant.
Computing

Fix those internet dead zones by turning an old router into a Wi-Fi repeater

Is there a Wi-Fi dead zone in your home or office? A Wi-Fi repeater can help. Don't buy a new one, though. Here is how to extend Wi-Fi range with another router you have lying around.
Computing

Lost your router? Here's how to find its IP address to help track it down

Changing the login information for your router isn't always easy, that's why so many have that little card on the back. But in order to use it, you need to know where to go. Here's how to find the IP address of your router.
Computing

Acer Swift 7 vs. Apple MacBook Air

The Acer Swift 7 accomplishes its goal of being the world's thinnest notebook, and it's well-built to boot. But is that enough to take on the Apple MacBook Air in terms of being the better to actually use?
Product Review

It's not just light. Alienware's m15 is an entirely new breed of gaming laptop

Thin and light gaming is a new category of laptop, led by options like the Razer Blade. Alienware now has its own entry -- The Alienware m15. It’s not the thinnest, lightest, or sleekest option in the bunch, but it doesn’t hold back in…
Computing

Asus ZenBook 14 UX433 vs. Dell XPS 13

The Asus ZenBook 14 UX433 has some incredibly tiny display bezels, in an effort to jam a 14-inch notebook into a 13-inch chassis. That pits it against the Dell XPS 13, the icon of small clamshells.
Computing

Intel’s 28-core monster Xeon CPU might cost upwards of $4,000

Intel's new-generation 28-core Xeon CPU will debut with a hefty price tag. Although not quite as expensive as some of its predecessors, early pre-order pricing has it costing between $4,000 and $5,000.
Computing

Lenovo’s first ThinkPads with Intel Whiskey Lake processors to arrive this month

Lenovo has opted not to wait for CES 2019 next month to introduce the first ThinkPads with Intel's Whiskey Lake Core I5-8265U and Core i7-8565U processors. They will arrive onboard the new ThinkPad L390 and L390 Yoga.
Computing

LG’s new monitor gives you screen space galore without hurting your wallet

LG's new 32-inch display could be your next great upgrade. For $350, it offers the complete package of high resolution, high refresh rate, and 32 inches of screen space. What more do you need?
Computing

PewDiePie supporters hack printers, hope to boost his subscription numbers

In an attempt to garner more subscribers for their favorite vlogger and secure his status as having the most YouTube subscribers, PewDiePie supporters claimed to have hacked thousands of printers worldwide.
Web

Chrome fights manipulative sites that don’t allow you to hit the back button

Have you encountered a webpage that won't let you hit the back button? Someun scrupulous websites employ what's known as history manipulation, preventing you from hitting the back button, but now Google Chrome will be fighting back.
Gaming

With our Steam guide, you can give the gift of gaming this holiday season

The holidays may have passed, but it's always a good time to give the gift of gaming (especially when there's a Steam sale)! Here's our quick guide on how to give a Steam game as a gift.