So recently i wanted to block website. So i found out the ip address of the website using ping command and blocked it using the ip filter on my router configuration page eg: for D-Link.

But again after some time i also found out that that website also has an equivalent android app like facebook.com and facebook android app and my question is when i blocked the ip address of the website will it automatically block the app from using the wifi also or the ip addressess of website and android app different? if they are different how to find that out and block that ip also and make sure that app dosent connect to the internet?

Don't ask me why are you even installing the app on your phone if you want to block that badly. The thing is i want to stop my family members also from using that app through wifi ip block because as usual they don't listen to me. And the website and app are bad like Really bad.

  • 2
    @Firelord In the times of cloud services an IP can change at any time. Additionally you may block other services that are hosted on the same IP address. Russia for example tried to block Telegram service on IP level some time ago. They made a lot of "collateral damage" on other services hosted on the same cloud instance, but Telegram just switched to a new IP. Therefore from my perspective a DNS based block will be more reliable. – Robert Dec 31 '20 at 16:36
  • 1
    In continuation to the the previous comments, a service (a mobile app or website or web app) might be using multiple domain names (which is hard-coded in the app or the app fetches from remote server) which might resolve to scores of IP addresses (which may also keep on changing). So while the domain (DNS) blocking is more reliable, the blockage can't be guaranteed. You need to keep an eye on app's activity if you don't want to block it entirely on the device. This question may help: How to view network traffic requested by a specific app? – Irfan Latif Dec 31 '20 at 16:50

Large services like Facebook have own servers for web-site and mobile apps. Other services have one (API) server for both. Therefore there can be a relationship between the server of the website and the server used by the Android app but does not have to be.

The large services even have multiple servers distributed around the world that share the same DNS name. Therefore if you want to block something on IP level your filter list will soon be very long.

An relative simple way to get all IP addresses an app communicates with is sniffing it's traffic. Even if the traffic will be mostly HTTPS and therefore encrypted the destination IP is always visible in plain text in each IP packet.

There are apps like PacketCapture that allow you to get the complete IP addresses an app communicates with. After identifying a few IP addresses I would re-run the app while sniffing it with PacketCapture to make sure there are no alternative addresses the app just switche to if the main IP is not accessible. Also keep in mind that you have to periodically check the IP addresses again as they will change from time to time.

Keep in mind in the times of cloud services the IP address of a service can change at any time and your block may also block other services that are running by coincidence on the same server.

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.