Hot answers tagged

1

If you are modifying /etc/hosts in the Docker container itself, then only processes within the Docker container are going to be able to resolve that domain locally. Thus, if you are using a browser on your Mac to access a port exposed by Docker, it knows nothing about the DNS override and will try to hit the real site -- which likely explains the message ...


1

Edit your hosts file: sudo vi /etc/hosts Add URLs you want to block. This should be sufficient: # Block YouTube 127.0.0.1 youtube.com 127.0.0.1 www.youtube.com 127.0.0.1 youtu.be 127.0.0.1 www.youtu.be 127.0.0.1 youtube-nocookie.com 127.0.0.1 www.youtube-nocookie.com Reset the Directory Service cache dscacheutil -flushcache Ping the the hosts for ...


Only top voted, non community-wiki answers of a minimum length are eligible