I do this too. It's pretty crazy how often I find myself staring at an error page wondering what happened.
Forgive my ignorance, but what does this do? I'm interested. Would I just add Twitter/Reddit/whatever to the file with an IP of 0.0.0.0 so it throws an error or something?
When you go to a website, there's a DNS lookup to find the IP address to use for it. By setting this you can tell your computer "instead of actually going to HackerNews, go to [website] instead"
I prefer 127.0.0.1. That's a "self" IP that will redirect to your own machine. If you have no web server setup, it'll just give a 404/not found error. If you do have one, then you have some more creative options given you're visiting it as a result of going to site you're trying to wean yourself off of.