Block websites on your computer

Table of contents:

Block websites on your computer
Block websites on your computer
Anonim

Blocking a website, for whatever reason, is easier than most people think. Although it does require a bit of programming, most of the work involves copying and pasting, and all internet browsers offer the ability to block websites without much effort. Make sure you fully understand the instructions before proceeding. You need an administrator account (administrator account) to make the following changes. This means that you must be the main user of the computer and have the corresponding passwords.

Steps

Method 1 of 3: Blocking websites in Windows

Block a Website on Your Computer Step 1

Step 1. Open 'My Computer' and search your C drive

To block a website on a browser you will need to modify the HOST file. This file helps resolve URLs, such as www.google.com, to a numeric DNS address. However, you can also use this conversion to make sure that your computer can never open certain websites again, all with a small adjustment.

If you don't see the "Windows" folder in C:, look in another drive. C is almost always the default mapped drive for Windows, but you may have installed Windows yourself and chose a different location

Block a Website on Your Computer Step 2

Step 2. Locate the 'etc' folder in the drivers folder

To get there, click on Windows –>System32–>drivers–>etc. In the etc folder, look for the file 'Hosts'.

  • The last location you need is C:\WINDOWS\system32\drivers\etc. You can type this in the top bar of My Computer if you can't find it.
  • You can also find this by typing 'notepad C:/Windows/System32/drivers/etc/hosts' in the command window. The command prompt can be found and opened via the start menu.
Block a Website on Your Computer Step 3

Step 3. Open the 'Hosts' file with the Notepad program

Double click on 'Hosts' and choose 'Notepad' when asked which program you want to use. Allows you to edit the file and block certain websites.

If you don't see the option to use Notepad, open the application separately. Click 'File' → 'Open' in Notepad and go to Hosts as you did before. Click on it to open the file

Block a Website on Your Computer Step 4

Step 4. Scroll to the empty space at the bottom of the file

You will see a lot of code and text, but you don't have to change that. Scroll all the way down to the last line, which will probably look something like '127.0.0.1 localhost'.

Do not change anything while you are working. This file is essential for your internet connection and all you need to do to block websites is add a few extra lines at the bottom of the text

Block a Website on Your Computer Step 5

Step 5. Press Enter to create a new line at the very bottom

Start your new line directly below the last line with 'localhost'.

Block a Website on Your Computer Step 6

Step 6. Block websites by typing '127.0.0.1' followed by the URL of the website

At the beginning of the line, type '127.0.0.1', then a space, and then the full URL of the website. For example, to block Google, type '127.0.0.1 www.google.com'.

Do not add the 'http://' to the URL, otherwise the website will not be blocked

Block a Website on Your Computer Step 7

Step 7. If you want to block more websites, put them each on a separate line

If you want to block multiple websites, press Enter again for a new line. Type '127.0.0.1' and then the web address. There is no limit to the number of websites you can block.

Block a Website on Your Computer Step 8

Step 8. Save the file

When you're done blocking websites, click 'File' → 'Save'. Close the browsers you have open and then open them again. The websites should be blocked in every internet browser you use.

Method 2 of 3: Blocking websites on Mac

Block a Website on Your Computer Step 9

Step #1. Open Terminal

Here you can make changes to your Mac as an administrator. Use the search bar to find it, or via Finder under /Applications/Utilities/Terminal.

Terminal is a black and white text box. This allows you to modify certain code on your computer

Block a Website on Your Computer Step 10

Step 2. Make a copy of your current hosts file in case you do something wrong

You won't make any major or difficult changes to the file, but it's always better to make a backup. To make a copy automatically, type 'sudo /bin/cp /etc/hosts /etc/hosts-original' at the Command Line and press Enter.

You may be asked to enter your administrator password. This is the password you use to log in to your computer

Block a Website on Your Computer Step 11

Step 3. Open the hosts file

Type 'sudo nano /etc/hosts' and press Enter to open the hosts file in another window. This is the file you will modify to block websites. Scroll down, all the way to the bottom, past the last line (usually something with 'localhost').

Block a Website on Your Computer Step 12

Step 4. Start a new line with '127.0.0.1'

This tells your computer to block the website that follows. Write down the number and press the spacebar.

Block a Website on Your Computer Step 13

Step 5. Type the web address you want to block after the number with one space in between and start with www

So if you want to block Google, type '127.0.0.1 www.google.com'. Make sure to put this on its own line.

Do not add 'http://' to it

Block a Website on Your Computer Step 14

Step 6. Each website you want to block will have its own rule

If you want more websites, press Enter, and type '127.0.0.1', a space and the web address. This will block those websites completely from your computer and for any browser.

Block a Website on Your Computer Step 15

Step 7. Save the file

Press Control Key + O (the letter, not zero) to save the file and close the window. Your changes will now take effect almost immediately.

Block a Website on Your Computer Step 16

Step 8. Restore the cache for the changes to take effect

Still in Terminal, type 'sudo dscacheutil -flushcache' and hit Enter. This will clear the cache for your changes to take effect. Open a browser to test if it worked.

  • If it didn't work, take another look at the Host file, and make sure your changes are at the end, on separate lines, and in the correct format.
  • If it still doesn't work, restart your computer and try the websites again. They will be blocked.

Method 3 of 3: Block websites by browser

Internet Explorer

Block a Website on Your Computer Step 17

Step 1. Open Internet Explorer

Internet Explorer (IE), Microsoft's browser, makes it easy to block specific websites without too much extra work. However, these changes will not take effect in other browsers, such as Firefox.

Block a Website on Your Computer Step 18

Step 2. Click Tools and then Internet Options, located in the main menu

A window will now open with settings that allow you to customize the websites that are blocked. There are several tabs at the top of the window that allow you to adjust the settings.

In newer versions of IE, this is represented by a cog, not 'Tools'. Click on the gear and select 'Security Settings'

Block a Website on Your Computer Step 19

Step 3. Click on the Privacy tab and then on 'Sites'

Type in the web address of the website you want to block and click OK. Remember that this technique cannot block more than one website at a time.

In newer versions of IE, click on 'Restricted websites', then 'Websites'

Block a Website on Your Computer Step 20

Step 4. Use your Microsoft account to block certain websites in the new version of IE, also known as 'Edge'

To block websites in Edge you need a Microsoft account. This allows you to indicate your preferences online and ban websites that you want to block from your account.

You can do this by going to

Mozilla Firefox or Google Chrome

Block a Website on Your Computer Step 21

Step 1. Open your web browser

Firefox and Chrome don't have built-in website blocking capabilities, but you can download a free plugin that makes it easy to do so.

In Chrome you need the Chrome Web Store. In Firefox, these additions are called 'Add-ons'

Block a Website on Your Computer Step 22

Step 2. Browse through the selection of add-ons and find what you need

Click on the three gray bars in the top right corner of Firefox, then choose "Add-ons" to search through a selection of parental control tools and website blockers. In Chrome, click the 'Apps' button in the top left corner, then click 'Web Store'.

Block a Website on Your Computer Step 23

Step 3. Find and download the right plugin for you

Mozilla has a handy page for this that lists the best blocking and parental control add-ons. For easy blocking of websites on both sites, the best choice is the simple but effective 'BlockSite'.

  • If you want more robust programs, search for 'parental controls' or 'parental filters' in the webstore or add-on library. These programs have special options, such as a pornography filter, that allow you to block all kinds of websites.
  • Once downloaded, the plugin will open and ask you which websites should be blocked.
  • If you can't find the right plug-in, click on the three bars in the corner and then on 'Add-ons' (Firefox) or 'Extensions' (Chrome).

Safari

Block a Website on Your Computer Step 24

Step #1. Open Safari and click on the Apple logo in the top right corner

This will show you a number of options and preferences. Safari doesn't block websites, but lets you choose which ones you want to view, making this form much more restrictive.

Block a Website on Your Computer Step 25

Step 2. Select System Preferences and go to Parental Controls

It allows you to block websites and give yourself an administrator account, making you the one who controls what other users can view on Safari.

Block a Website on Your Computer Step 26

Step 3. Click on 'Convert this account to a parental control account'

This requires an administrator account. An administrator account is the account you use to log into the computer during startup. Once you have entered that, you can open the parental control window.

Block a Website on Your Computer Step 27

Step 4. Click on 'Web' and then 'Allow access to these websites only'

This will activate the restrictions for Safari. You can now add pages using the '+' button and 'Add bookmarks'.

Popular by topic