Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone/ Android will not dismiss wifi landing page implemented with DNS

I am trying to implement a splash page/ wifi landing page on my existing public wifi network, using the DNS method mentioned in Wiki, in which I host a custom DNS server, that will redirect ALL dns lookup to a local address where a web server is hosted, for all user before they click agree.

After the user clicked agree, my custom DNS server starts returning correct ip for the look up, thus, user will be able to get online.

note: We totally understand that this is in no way secure our network, and even putting our network at risk. But the goal here is to just to pop the landing page up in front of our users.

This approach actually works on Windows Phone (Windows 8 I tested) as splash page, and even on a computer when I try to open a random website, it redirects me to my page, and after I hit agree, I can get to the internet.

When I try it on iPhone/ Android, once I connect to the hotspot, the splash page/ wifi landing page appear as expected (because the device is trying to verify internet access by going to the set of pages) However, after I click agree, and allow internet access, both iPhone and Android splash screen will not go away. I have to force iphone to "use this wifi without network" to exit.

I wonder if there is a special (javascript?) method I can call in the page, or some package I need to send to the device? I noticed on iOS, if I click a link to the App Store, the splash page go away without disconnecting from the network, So, I guess I am missing something here.

For example, clicking the link to the iOS StackOverflow App on iOS device can be a workaround.

Had been googling around for a week now, nothing seems to came up.

by the way, I am building my custom dns server on node js, with the module dnsd.

=-=-=

=-=-=-=-= edit =-=-=-=-=-=

I also uploaded a demo of my code on GitHub: https://github.com/kylelam/dnsd_wifi

To test it, run it in your local network (sudo node demo.js). Then, change your phone's dns to your machine's IP. Disconnect your phone from wifi and connect to it again. (on iOS, you might need to go into detail, and enable auto-login, and auto-join, or if you can't, just reboot.)

*note1: the server will need to run on port 53, and 80, so it need sudo.

*note2: please don't laugh at my code, I'm very new to this. But please do point out.

*note3: you will need to npm install these packages: os, express, dns, dnsd

like image 229
kaho Avatar asked Feb 24 '17 09:02

kaho


1 Answers

ttl set to 0 might be the cause of the issue, try a different value like 5.

like image 173
Allen Avatar answered Oct 31 '22 21:10

Allen