Page 1 of 1

Answering second IP address?

PostPosted: Wed Mar 13, 2019 4:00 pm
by treii28
I'm revisiting the issue of the Captive Portal not triggering the android/apple helpers to properly redirect to a landing page when connecting to an esp8266 wifi access point.

One of the suggestions I found on another forum said that the android devices in particular may try to make a DNS lookup directly to the google default DNS servers if they fail to get an answer they think is reliable for a mock-DNS response such as the typical DNSServer.h type 'respond to everything with the AP address'.

They said they got the pop-up to properly trigger with the helper-redirect by answering DNS on and/or

I'm wondering if it's possible to configure the esp8266 to answer DNS queries directed at to test this theory.

Re: Answering second IP address?

PostPosted: Wed Mar 13, 2019 4:57 pm
by treii28
I may also want to do this for another method but not for answering DNS requests but for spoofing a redirect on as though it was on one of the various device connectivy check urls. But it's the same basic issue.

The old method was to redirect everything to the softAP ip address and then answer the various connectivy check urls (such as google's generate_204) with a 30* redirect. (I've seen people use multiple 300 response codes in examples). This used to work, but doesn't any longer.
One suggestion I saw was that if the netmask of the connected network appears to include the address returned by DNS, it may try to use a different (non TCP/http) method to check if the connection is active. Thus the suggestion was to respond to the DNSServer request with an IP address 'not' on your access point's netmask range so it wouldn't try the alternate method. This still doesn't generate the pop-up so I wanted to try it by actually answering the generate_204 address on the other network address, but I don't know how to get the esp8266 web server to answer the requests on the second IP address.

Re: Answering second IP address?

PostPosted: Wed Mar 13, 2019 6:10 pm
by RichardS
I wish in the ESP8266 and ESP32 libs that the DNS object would allow many entries and not just one.... :-)


Re: Answering second IP address?

PostPosted: Thu Mar 14, 2019 10:02 am
by treii28
Check out the Captive portal issue on the mobile rick roll github project. He modified the DNS to allow overrides for specific hosts already. But it's still not triggering the helper redirect.