Monday, August 27, 2018

domain name system - How to Detect Split Horizon DNS from a Single Device



I'm building an iOS app that uses Bonjour for device discovery on the same WiFi network. It works fine on some networks, but not on others (like Starbucks or Panera). The devices see themselves, but not each other.



I got a tip that these networks may be using Split Horizon DNS. I've confirmed that I cannot ping one device from another.



The problem is, I want to show an error message if the WiFi network won't work.



I thought maybe I wouldn't be able to ping myself on such a network, but I can.




What is the best strategy for detecting Split Horizon from a single device? In other words, I cannot ping another device at runtime since I don't know anything about other devices.


Answer



As mentioned, this is almost certainly due to wireless clients being isolated. It makes perfect sense to do this on public wifi networks and I'd be surprised if any public networks don't do it. (With client to client communication enabled someone could sit on the network trying to hack other users devices. It's a large security risk for users and when you're providing a hotspot for Internet access what's the point in allowing clients to see each other).



If you can't ping other clients at all (by IP address) then it clearly has nothing to do with DNS.



I can't see any way to detect this and there is no real simple solution to get round it. Some apps use a central server which all clients connect to, which relays data between clients (such as IM apps), although depending on the goal of your app that may not be a viable solution.



The most obvious answer is that your app will just have to tell the user it can't find any other clients, maybe with a more information button/section that details the fact that it may not be able to discover other clients on certain networks (especially public ones).


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...