Add DNS entry for ESP32C5 when in AP mode
Posted: Tue Apr 21, 2026 5:05 pm
Using the ESP32C5 in AP mode (not STA) we need to have the device display HTTP web pages when accessing 'www.config.company.com'.
We have the device in AP mode using the following...
wifi_config_t wifi_config = {
.ap = {
.ssid = "configure",
.ssid_len = strlen(apSSID),
.channel = 1,
.password = "password",
.max_connection = 3,
.authmode = WIFI_AUTH_WPA2_PSK,
.gtk_rekey_interval = 0,
},
};
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_AP));
ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_AP, &wifi_config));
ESP_ERROR_CHECK(esp_wifi_start());
How do we configure the device to responds to DNS requests to 'www.config.company.com'?
We have the device in AP mode using the following...
wifi_config_t wifi_config = {
.ap = {
.ssid = "configure",
.ssid_len = strlen(apSSID),
.channel = 1,
.password = "password",
.max_connection = 3,
.authmode = WIFI_AUTH_WPA2_PSK,
.gtk_rekey_interval = 0,
},
};
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_AP));
ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_AP, &wifi_config));
ESP_ERROR_CHECK(esp_wifi_start());
How do we configure the device to responds to DNS requests to 'www.config.company.com'?