SoftAp with Domain Name

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

SoftAp with Domain Name

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

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

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 ( 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.


User avatar
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 ( 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:

Posts: 2111
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.

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 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.

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.

Return to “General Discussion”

Who is online

Users browsing this forum: squonk11, vonnieda and 25 guests