Block Access to Specific Websites
To block Facebook, Instagram, Twitter, and YouTube on a Windows Server (for a VM), you can restrict access using one or more of the following methods, depending on your setup and control level.
Method 1: Edit the Hosts File
This blocks access at the DNS level for that specific machine.
Steps:
Open Notepad as Administrator
Go to:
C:\Windows\System32\drivers\etc\hosts
Add the following lines at the bottom:
127.0.0.1 facebook.com 127.0.0.1 www.facebook.com 127.0.0.1 instagram.com 127.0.0.1 www.instagram.com 127.0.0.1 twitter.com 127.0.0.1 www.twitter.com 127.0.0.1 youtube.com 127.0.0.1 www.youtube.com
Save the file.
Flush DNS with:
ipconfig /flushdns
Note: This method is easy to bypass by tech-savvy users and doesn’t work over HTTPS in all cases.
Last updated
Was this helpful?