As you know, many people are using custom roms. almost all custom roms ve changed hosts file which is blocking access(sends requests to 127.0.0.1 for ads) to admob.
is there any way to overcome about it ? Perhaps not possible to change hosts file programmatically but maybe we can define the ip for admob in our apps,cant we? as such issues what are you doing for prevent an adblocker?
i wouldnt prefer to block my app to using by users if the app detects an adblocker.
If you are using standard system calls to resolve a host to IP, there is not much you can do to prevent a user from controlling how their DNS is configured to resolve. I haven't done this on Android, but you could roll out your own DNS resolution function goes out by itself to a DNS server such as Google's 8.8.8.8 and resolves an IP for you.
The other alternative, as you mentioned, is to simply use IP addresses, possibly one you own, and then redirect to wherever you want.
Or best yet, just let users control what they do with their DNS? Has this really been such a big problem?