-1

I am working on OSX and I want to block access to an individual URL (a twitter profile) in /etc/hosts.

Is this possible? I've tried adding:

127.0.0.1      twitter.com/mypath
127.0.0.1      www.twitter.com/mypath

and then running sudo dscacheutil -flushcache, but it doesn't seem to do anything, I can still see the page.

Richard
  • 263
  • 2
  • 5
  • 11

1 Answers1

2

No, /etc/hosts is static DNS lookup table. It comes to play way before you use url.

When you try to open URL this happens

  1. DNS resolution (here is /etc/hosts active) > resolve twitter.com to ip address
  2. tcp connection establiched to ip
  3. then http protocol come to play
Aroly7
  • 474
  • 2
  • 7