3 Easy Ways to Block Website

These days there are a number of reasons why we may want to block a website. In some cases, it’s because the site has questionable or objectionable content that might pose harm to people such as children. And sometimes the sites are just time sucks. Fortunately, you can learn how to block access to a website with these easy methods.

Why Block Site Access

Most of us would agree that the Internet has its share of scary places. Some sites are rabbit holes I don’t want anyone to venture down. Aside from parental controls and security, another reason is time. Many sites can be addicting and unproductive. Some categories people have mentioned include:

  • Social networking sites
  • Auctions sites
  • Political sites
  • YouTube
  • Adult sites
  • Sports sites
  • Finance sites
  • News sites

The suggestions below on how to block a website are easy to implement. Each has its advantages and disadvantages. One advantage they all share is they are not browser dependant. This makes the solutions work regardless if someone is using Google Chrome, Firefox, Safari, or Microsoft Edge.

Use OpenDNS to Block Categories or Websites

OpenDNS is a Cisco owned-company that provides free DNS servers. Typically, your internet service provider (ISP) provides your DNS. If you’re not familiar with DNS, it’s like the Internet’s phone book. Instead of typing in an IP address, you can type a domain name.

I’ve been using the service for years but didn’t realize all the features they offered until recently. One feature is the ability to block domains or groups of domains.

The service appeals to me for three reasons. The first is that it’s one of the fastest DNS services I’ve used. They were also immune to the latest DNS security issues that took place last year. Secondly, the settings can apply to a specific computer or your network. Lastly, the service is free.

If you create an account with the service you can gain access to more features. If you need to restrict access, OpenDNS has over 50 category filters covering the usual suspects. Moreover, you can choose to block specific websites. For a small yearly fee, there are enhanced services you can get such as faster DNS and support.

OpenDNS custom category section.

When a browser goes to a blocked domain, an error message will display.

Use your Router Software

Another way to block websites is with your internet router. A router is a piece of hardware that directs traffic between your network and the internet. Most popular routers offer some sort of “parental control” or “internet access policy”. The key for many people may be remembering how to use that administrative panel. Usually, you can find this information from the manufacturer’s website.

Block website with router's settings.

The screen snap above represents the configuration panel on my router. In this case, I’m allowing access to use the internet all the time except for the eBay domain that I’ve blocked. These options differ between manufacturers. Like OpenDNS, the router may offer you the best option as the changes can apply throughout your network or to a specific PC or MAC address.

Some of these systems also allow you to regulate Internet access based on the day of the week or hour.

Use the Hosts File

This approach can be as easy or complicated as you like. We wrote an article about hosts files several years ago. The idea is that you redirect your web browser to go to another IP address, such as your local machine, rather than the intended site. In most cases, the fix requires you to add a line to your computer’s Hosts file using a text editor.
Example of YouTube added to hosts file.

In the example above, I added a line for YouTube.com at the bottom. If I now try to access the site with my browser, I’ll get an error message similar to the one below. The message is a bit cryptic and probably wouldn’t make you look at your hosts file. However, one line did allow me to block access to a website.

Error message when trying to connect to YouTube.

Hosts File Limitations

While using the hosts file is easy, there are limitations:

  1. You need to have administrative rights to the Hosts file.
  2. You may need to put multiple lines in to represent other pages being accessed in the domain. For example, if someone wants to reach a specific profile page or subdomain, you’ll want to add these blocks as well. You can’t assume people will always start at the home page for a site. Some sites also have canonicalization issues and can be reached using “www.” or without.
  3. The block will only work for that specific computer.

The above suggestions aren’t the only options for restricting internet viewing or access. There are commercial software packages that limit internet viewing. You may find another option is to use a service like RescueTime which quantifies viewing habits and program usage. It may show something about your own behavior. The point to remember about all these measures is people will try to get around them. This isn’t surprising if someone thinks a site is that valuable.