HACKER Q&A
📣 justinzollars

Why does Safari Ignore etc/hosts?


I use etc/hosts to prevent myself from visiting websites like twitter and facebook by redirecting traffic to localhost.

Using Safari I'm unable to redirect traffic to localhost when connecting to drudgereport.com. This trick works for Chrome. What am I doing wrong?

etc/hosts:

127.0.0.1 drudgereport.com ::1 drudgereport.com

127.0.0.1 www.drudgereport.com ::1 www.drudgereport.com

I've also tried fe80::1%lo0 rather than ::1.

dscacheutil -q host -a name drudgereport.com name: drudgereport.com ipv6_address: 2606:4700:10::ac43:c8c ipv6_address: 2606:4700:10::6816:5cf ipv6_address: 2606:4700:10::6816:4cf

name: drudgereport.com ip_address: 127.0.0.1


  👤 LinuxBender Accepted Answer ✓
Not sure if this is your issue, but read through some of the answers here [1]

[1] - https://apple.stackexchange.com/questions/158117/os-x-10-10-...


👤 floatingatoll
If you remove your hosts entries from /etc/hosts and then create your hosts entries using dscacheutil, and then restart Safari, does Safari begin respecting them?