Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know how to edit my hosts file on osx, how can I block the range What do I put in the hosts file?

share|improve this question

You cannot.

/etc/hosts is not for blocking – it is for translating domain names to addresses (when other methods are unavailable) – more specifically, an exact name to a single address. If a program tries to access the address directly, the system won't even touch /etc/hosts, because there will be nothing to look up.

Use a proper firewall, such as ipfw.

share|improve this answer

A simple way to null a range of ip is:

route add lo

Use the routing table to do it :)

share|improve this answer
how can I access the routing table? – John Dec 6 '11 at 13:22
You can just try the command I posted if you are using GNU/Linux :) – Felix Yan Dec 6 '11 at 14:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.