Get a Pentest and security assessment of your IT network.

Cyber Security

Block Social Media on Windows

TL;DR

This guide shows you how to block access to social media websites on a Windows computer using the Hosts file and/or your router’s settings. It covers both temporary and more permanent blocking methods.

Blocking Social Media Using the Hosts File (Temporary)

  1. Open Notepad as Administrator: Search for ‘Notepad’, right-click it, and select ‘Run as administrator’. This is important; otherwise you won’t be able to save the file correctly.
  2. Open the Hosts File: In Notepad, go to File > Open. Navigate to C:WindowsSystem32driversetc. In the ‘Files of type:’ dropdown, select ‘All Files (*.*)’. Select the ‘hosts’ file and click ‘Open’.
  3. Add Social Media Sites: At the end of the file, add a line for each website you want to block, following this format:
    127.0.0.1   www.facebook.com
    127.0.0.1   facebook.com

    Repeat for other sites like Twitter (now X), Instagram, TikTok, etc. Include both the ‘www.’ and non-‘www.’ versions to be thorough.

  4. Save the File: Go to File > Save. If prompted about saving as a different type, confirm you want to save it as ‘All Files’ and keep the filename as ‘hosts’.
  5. Flush DNS Cache (Important): Open Command Prompt as administrator (search for ‘cmd’, right-click, ‘Run as administrator’). Type ipconfig /flushdns and press Enter. This forces your computer to read the updated Hosts file.

To unblock: Remove the lines you added from the hosts file and flush the DNS cache again.

Blocking Social Media Using Your Router (Permanent)

  1. Access Your Router’s Settings: Open a web browser and type your router’s IP address into the address bar. Common addresses are 192.168.0.1 or 192.168.1.1. If neither works, check your computer’s network connection details (see step 4).
  2. Log In: Enter your router’s username and password. These are often printed on a sticker on the router itself. If you changed them previously, use those credentials.
  3. Find Parental Controls/Access Restrictions: The location of these settings varies by router manufacturer. Look for sections like ‘Parental Control’, ‘Access Restriction’, ‘Website Filtering’, or similar.
  4. Add Blocked Websites: Most routers allow you to enter website addresses (URLs) to block. Add the social media sites you want to block (e.g., www.facebook.com, facebook.com). Some routers also let you block by keyword.

    Finding your Router’s IP Address: Open Command Prompt and type ipconfig then press Enter. Look for ‘Default Gateway’. This is usually your router’s address.

  5. Save Changes & Reboot Router: Save the changes you made in your router settings. You may need to reboot your router for the changes to take effect.

To unblock: Remove the websites from the blocked list in your router’s settings and save the changes.

Important Considerations

  • HTTPS: Blocking only ‘www.facebook.com’ might not be enough, as many sites use HTTPS. Block both HTTP and HTTPS versions if possible.
  • VPNs & Proxies: Users can bypass these blocks by using a VPN or proxy server.
  • Router Variations: Router interfaces differ significantly. Consult your router’s manual for specific instructions.
Related posts
Cyber Security

Zip Codes & PII: Are They Personal Data?

Cyber Security

Zero-Day Vulnerabilities: User Defence Guide

Cyber Security

Zero Knowledge Voting with Trusted Server

Cyber Security

ZeroNet: 51% Attack Risks & Mitigation