Page 1 of 1

SoftAp with Domain Name

Posted: Fri May 25, 2018 4:12 am
by Franck
Hello,
Is there an ESP-IDF example for a webserver with a domain name in SoftAP mode?
The examples I found use the IP address to access the webserver.
Couldn't find any using a domain name as www.xxx.com.

I suppose I need a DNS server running on the SoftAP to do a redirect to the ESP32 IP address. But I haven't found the way to do it.

I am porting an existing system to ESP32, and the domain name is fixed (www.sensor.com) so I don't think I can use mDNS as it would need to be changed to xxx.local.

Any link to examples or directions on how to do this would be welcome.

Thanks,
Franck.

Re: SoftAp with Domain Name

Posted: Fri May 25, 2018 4:06 pm
by kolban
Howdy Franck,
My loose understanding is that the domain name system is like a database which maps symbolic names (www.xxx.com) to their IP addresses. The registration of which name maps to which IP address is not performed by the device that has that IP address but is rather done by the network / DNS administrator.

If your target machine has a dynamic IP address (i.e. dynamically allocated) then DNS isn't an option because DNS maps names to static IP addresses (this is a loose statement ... in enterprises there may be special hardware and software that performs load balancing that sprays work for the same name/IP address to multiple back-end systems).

Where we have dynamic IPs, mDNS is then a candidate but that is usually very local.

Is your goal to have your ESP32 addressible over the "Internet" or have it resolved locally (for example just in your house or office)?

Re: SoftAp with Domain Name

Posted: Sat May 26, 2018 2:06 am
by WiFive
He is talking about captive portal.

https://github.com/search?q=esp32+dns

Re: SoftAp with Domain Name

Posted: Mon May 28, 2018 3:38 am
by Franck
Howdy Kolban,
The idea here is to have a webserver and a DNS server implemented on the same ESP32 SoftAP.
I think it works this way:
1- Client connects to the ESP32 SoftAP
2- Client web browser sends a DNS resolution request for www.xxx.com to the ESP32 (UDP port 53)
3- ESP32 resolve DNS request and returns its own IP address
4- Client web browser uses the received IP to get the ESP32 webserver page.

But I guess you already know this since my DNS understanding comes from your book ;)!

Hi WiFive,
That's exactly what I am looking for.
I spent 2 days trying to find examples, I was only getting Arduino results...
I guess I am not using the right keyword.
Thanks!

Re: SoftAp with Domain Name

Posted: Thu Jan 24, 2019 6:38 pm
by psiuciak
Is there a solution that uses mDNS component? Same scenario soft AP mode , serving web pages.

Re: SoftAp with Domain Name

Posted: Mon Sep 21, 2020 11:25 pm
by Baldhead
Hi,

"Is your goal to have your ESP32 addressible over the "Internet" or have it resolved locally (for example just in your house or office) ?"
A: In my case i want in boths.

I am really lost at the moment.

What i want to do ?
A: I want to have several websockets secure server running in a local area network(home, enterprise, school.....). I am writing a app in android/ios to connect to theses servers. In the future i want to have a cloud server to communicate with app and with theses servers.

So.
I need to have a unique domain or subdomain inside each esp32 ?
If so, how to set a domain based on concatenated esp32 EFUSE BLK0 mac address in production ?

How i would associate a smartphone app with these local servers ?
How i would associate a cloud server with these local servers ?

Thank's.