It looks like there are some options to set hostname and DNS functionality via LWIP, but I can't get them to work with a client. For example, here's some code that might go after the wifi start call:
Code: Select all
ESP_ERROR_CHECK(esp_wifi_start());
// ...later...
const char * hostname;
tcpip_adapter_ip_info_t ip;
uint8_t param = 0;
ESP_ERROR_CHECK(tcpip_adapter_dhcps_stop(TCPIP_ADAPTER_IF_AP));
ESP_ERROR_CHECK(tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_AP, CONFIG_ESP_NETNAME));
ESP_ERROR_CHECK(
tcpip_adapter_dhcps_option(
TCPIP_ADAPTER_OP_SET,
TCPIP_ADAPTER_DOMAIN_NAME_SERVER,
¶m,
sizeof(param)
));
ESP_ERROR_CHECK(tcpip_adapter_dhcps_start(TCPIP_ADAPTER_IF_AP));
Code: Select all
> nslookup streamer
DNS request timed out.
timeout was 2 seconds.
Server: UnKnown
Address: 192.168.4.1
DNS request timed out.
timeout was 2 seconds.
DNS request timed out.
timeout was 2 seconds.
*** Request to UnKnown timed-out
Code: Select all
>nslookup streamer
Server: UnKnown
Address: 0.0.0.0
*** UnKnown can't find streamer: No response from server
Do I need to know the domain here? How is it set? I'd prefer not to use mDNS because it introduces extra dependencies for Windows clients. Is there a way to get normal DNS working out of the box with the IDF?