3

I have seen that I can't block facebook by adding 127.0.0.1 on Windows 8! Searching on Internet let me know that I should use IP V6 loopback for blocking facebook. Now I have added the following lines to my etc/hosts file but it still doesn't work for me.

Here, there is a similar question but for apple and not for windows 8 Why can't I block Facebook using /etc/hosts on Mountain Lion (OS X)?

# Block Facebook IPv4
127.0.0.1     facebook.com
127.0.0.1     www.facebook.com
127.0.0.1   login.facebook.com
127.0.0.1   www.login.facebook.com
127.0.0.1   fbcdn.net
127.0.0.1   www.fbcdn.net
127.0.0.1   fbcdn.com
127.0.0.1   www.fbcdn.com
127.0.0.1   static.ak.fbcdn.net
127.0.0.1   static.ak.connect.facebook.com
127.0.0.1   connect.facebook.net
127.0.0.1   www.connect.facebook.net
127.0.0.1   apps.facebook.com
# Block Facebook IPv6
fe80::1%lo0     localhost
fe80::1%lo0     facebook.com
fe80::1%lo0     www.facebook.com
fe80::1%lo0     login.facebook.com
fe80::1%lo0     www.login.facebook.com
fe80::1%lo0     fbcdn.net
fe80::1%lo0     www.fbcdn.net
fe80::1%lo0     fbcdn.com
fe80::1%lo0     www.fbcdn.com
fe80::1%lo0     static.ak.fbcdn.net
fe80::1%lo0     static.ak.connect.facebook.com
fe80::1%lo0     connect.facebook.net
fe80::1%lo0     www.connect.facebook.net
fe80::1%lo0     apps.facebook.com
2
  • 1
    You do know it's not /etc/hosts on a Windows-machine? (It's C:\Windows\System32\drivers\etc\hosts. And you can use ::1 instead of the fe80::1%lo0 on Windows.
    – Rik
    Nov 9, 2013 at 23:19
  • Ya! I surely know that it's C:\Windows\System32\drivers\etc\hosts and the question implicitly means that it works for other sites except facebook. But I didn't know that in Windows I only should use ::1 . Using ::1 it worked well. Thank you a lot @Rik!
    – Johnny
    Nov 9, 2013 at 23:25

2 Answers 2

3

I found the solution thanks to the comment of @Rik. I had used the code that had been made for Apple operating systems, while in Windows I should have used ::1 instead of fe80::1%lo0. Anyway changing the file in this way solved the problem.

127.0.0.1     facebook.com
127.0.0.1     www.facebook.com
127.0.0.1   login.facebook.com
127.0.0.1   www.login.facebook.com
127.0.0.1   fbcdn.net
127.0.0.1   www.fbcdn.net
127.0.0.1   fbcdn.com
127.0.0.1   www.fbcdn.com
127.0.0.1   static.ak.fbcdn.net
127.0.0.1   static.ak.connect.facebook.com
127.0.0.1   connect.facebook.net
127.0.0.1   www.connect.facebook.net
127.0.0.1   apps.facebook.com


# Block Facebook IPv6
#fe80::1%lo0     localhost
::1     facebook.com
::1     www.facebook.com
::1     login.facebook.com
::1     www.login.facebook.com
::1     fbcdn.net
::1     www.fbcdn.net
::1     fbcdn.com
::1     www.fbcdn.com
::1     static.ak.fbcdn.net
::1     static.ak.connect.facebook.com
::1     connect.facebook.net
::1     www.connect.facebook.net
::1     apps.facebook.com
::1     edge-star6-shv-02-ams2.facebook.com
0
0

The code in your question is missing facebook.com and www.facebook.com for IPv4. Any request for facebook.com or www.facebook.com that is using IPv4 will still be looked up externally and work as usual. Add these lines:

127.0.0.1     facebook.com
127.0.0.1     www.facebook.com
1
  • That's right but those two lines don't solve any problems. Thus I had those two lines in the long list of all other blocked websites I haven't reported here. Thanks. I correct it in the question!
    – Johnny
    Nov 10, 2013 at 9:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .