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.


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?

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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