SoftAp with Domain Name

Franck
Posts: 7
Joined: Fri May 25, 2018 3:44 am

SoftAp with Domain Name

Postby Franck » Fri May 25, 2018 4:12 am

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.

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: SoftAp with Domain Name

Postby kolban » Fri May 25, 2018 4:06 pm

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)?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: SoftAp with Domain Name

Postby WiFive » Sat May 26, 2018 2:06 am

He is talking about captive portal.

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

Franck
Posts: 7
Joined: Fri May 25, 2018 3:44 am

Re: SoftAp with Domain Name

Postby Franck » Mon May 28, 2018 3:38 am

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!

psiuciak
Posts: 1
Joined: Mon Jan 21, 2019 3:01 pm

Re: SoftAp with Domain Name

Postby psiuciak » Thu Jan 24, 2019 6:38 pm

Is there a solution that uses mDNS component? Same scenario soft AP mode , serving web pages.

Baldhead
Posts: 467
Joined: Sun Mar 31, 2019 5:16 am

Re: SoftAp with Domain Name

Postby Baldhead » Mon Sep 21, 2020 11:25 pm

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.

Who is online

Users browsing this forum: Baidu [Spider] and 109 guests