Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. Join them; it only takes a minute:

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

Is there a way to use the files hosts.allow and hosts.deny in Android? I've searched over the internet but found nothing. I have to control access of both wifi and mobile networks. And limit the access to a certain domain. Just like a firewall do. I've tried to insert some iptables commands, but the system became very slow after these commands. Thanks in advance.

share|improve this question
up vote 3 down vote accepted

As far as I know, Android isn't setup to use hosts.allow and hosts.deny

However, it is setup to use a standard hosts file in /system/etc/hosts

Unfortunately, it doesn't support wildcards, so it might be difficult to limit the device to a single domain via that method.

iptables probably are your best bet - perhaps you could post the rules you attempted, and I can see if there's anything that could be causing them to run too slow?

share|improve this answer

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.