15 ms·
Ask HN: 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 6y agoNot 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-1-etc-hosts-private-etc-hosts-file-is-being-ignored-and-not-resol https://apple.stackexchange.com/questions/158117/os-x-10-10-...
- justinzollars 6y agoThanks, I dug into this for a while and the story is very complex: https://discussions.apple.com/thread/252049716 https://discussions.apple.com/thread/252049716 It has to do with Apple implementing new protocols which cloudflare supports: https://blog.cloudflare.com/speeding-up-https-and-http-3-negotiation-with-dns/ https://blog.cloudflare.com/speeding-up-https-and-http-3-neg...
- floatingatoll 6y agoIf 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?