Specify DNS Server in SoftAP mode

geo.espressif
Posts: 28
Joined: Tue Mar 31, 2015 7:27 pm

Specify DNS Server in SoftAP mode

Postby geo.espressif » Thu Sep 24, 2015 11:41 pm

How is it possible to specify to those connecting over soft-ap mode what DNS servers to use? As with others here I'm trying to implement a captive portal and would like the DNS server to be the gateway IP.

I can't see anything in the documentation but may have missed something. Is it possible?

Thanks !

User avatar
kolban
Posts: 131
Joined: Tue Jun 16, 2015 1:09 pm
Location: Fort Worth, Texas, USA

Re: Specify DNS Server in SoftAP mode

Postby kolban » Fri Sep 25, 2015 12:39 pm

I'd suggest studying the SDK API called "espconn_dns_setserver". That appears to allow you to identity up to two DNS servers for name resolution.

geo.espressif
Posts: 28
Joined: Tue Mar 31, 2015 7:27 pm

Re: Specify DNS Server in SoftAP mode

Postby geo.espressif » Fri Sep 25, 2015 5:39 pm

But aren't these functions for station mode? i.e. to set the DNS server to use when the chip does a host lookup?

I'm interested in setting the DNS server for clients connecting through the wifi interface to the chip itself.

Maybe the function does both though, I'll have a go in any case.

tve
Posts: 123
Joined: Sun Feb 15, 2015 4:33 pm

Re: Specify DNS Server in SoftAP mode

Postby tve » Sat Sep 26, 2015 2:06 pm

What you're asking for is how to set the DHCP options sent to the clients and I don't see a way to do that. Even if you did, what would you set the DNS server to? There's a wifi_softap_set_dhcps_offer_option() function in the SDK, but I don't think that does much useful to you.

geo.espressif
Posts: 28
Joined: Tue Mar 31, 2015 7:27 pm

Re: Specify DNS Server in SoftAP mode

Postby geo.espressif » Mon Sep 28, 2015 4:29 pm

That's what I thought, thanks tve. The dns_setserver doesn't work either.

Looking at the difference between the standard SDK binary release and my soft-ap hosting code, I can see that the binary SDK release is somehow specifying the DNS server, but I'm not sure how to replicate this in my code. In addition, my AP can't be seen by my iPhone, I'm not sure if the specification of a DNS option is responsible for this difference?

Now just looking to replicate the AP hosting code in the raw SDK binary.

blubb
Posts: 111
Joined: Mon Jun 22, 2015 5:35 am

Re: Specify DNS Server in SoftAP mode

Postby blubb » Mon Sep 28, 2015 8:59 pm

Have you tried this captive dns portal code?
https://github.com/Spritetm/libesphttpd ... /captdns.c

geo.espressif
Posts: 28
Joined: Tue Mar 31, 2015 7:27 pm

Re: Specify DNS Server in SoftAP mode

Postby geo.espressif » Mon Sep 28, 2015 9:36 pm

This is exactly what I'm using. Unfortunately it doesn't seem to work. I can see the DNS requests arriving but the browser on my laptop doesn't get redirected to 192.168.4.1. Chrome displays a DNS_PROBE_FINISHED_NO_INTERNET error.

jiskko
Posts: 2
Joined: Sat May 07, 2016 7:49 pm

Re: Specify DNS Server in SoftAP mode

Postby jiskko » Sat May 07, 2016 7:52 pm

solution for
DNS_PROBE_FINISHED_NO_INTERNET
?????///

jiskko
Posts: 2
Joined: Sat May 07, 2016 7:49 pm

Re: Specify DNS Server in SoftAP mode

Postby jiskko » Tue May 10, 2016 1:47 am

Here’s the mail I got recently who fixed my problem permanently
I have had 4 conversations with Microsoft and tried above without luck. Since I don't understand what they were doing when they were working remotely on my computer, I cannot explain what they did. I know they did something with "resetlog, netsh int ip reset and winsock". All without success. The long wait (3-5) hours to reach someone is a reality. My last contact was ended when the "DNS PROBE FINISH ..." appeared and I lost contact. I regret that no one has contacted me to see if the problem is resolved. The alternative is to get back in the 3-5 hour lineup!
Clearing browser history, download, cookies, cach seems to work temporarily. Time will tell. I have also notice more people having the problem when I do a google search. My computer guy indicates I should wait awhile to see if Microsoft figures out there is a problem and then updates the program. The more that complain the faster the fix.
I asked about reverting to Windows 8 and he said no that at some point in the future 8 will no longer be supported. Microsoft indicates I must make that decision within 30 days or the previous version will be removed from my computer.
Good luck
dns_probe_finished_no_internet chrome fix by deskdecode

Who is online

Users browsing this forum: No registered users and 7 guests