Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mesh][v4.4] DHCP Server not propagating backup DNS server (IDFGH-11391) #12530

Closed
3 tasks done
KonssnoK opened this issue Nov 6, 2023 · 8 comments
Closed
3 tasks done
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@KonssnoK
Copy link
Contributor

KonssnoK commented Nov 6, 2023

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Hello @zhangyanjiaoesp ,
we were having issues with one of our internal networks, where only the root node was able to connect to the external world and all the children would have unresolved DNS.

We found out that the dhcps implementation in 4.4 (but also on master, despite the changes) does not support propagation of the backup DNS server.

Our router broadcasts the DNS only in the secondary DNS slot, because the first one is dedicated to the firewall.

We created a patch for the dhcps, but it would make sense for this to be implemented in general.

Also, we cannot find a way to define FALLBACK_DNS_SERVER_ADDRESS apart from putting it in the Cmakefile.
How is it supposed to be setup?

Thanks

@espressif-bot espressif-bot added the Status: Opened Issue is new label Nov 6, 2023
@github-actions github-actions bot changed the title [mesh][v4.4] DHCP Server not propagating backup DNS server [mesh][v4.4] DHCP Server not propagating backup DNS server (IDFGH-11391) Nov 6, 2023
@xueyunfei998
Copy link

hi @KonssnoK
You can use this interface esp_netif_set_dns_info

esp_netif_dns_type_t = ESP_NETIF_DNS_FALLBACK

@KonssnoK
Copy link
Contributor Author

KonssnoK commented Nov 6, 2023

hello @xueyunfei998
this interface would be ok for the children but not for the root. When DHCPS is enabled, it is impossible to set the fallback DNS.


    if (esp_netif->flags & ESP_NETIF_DHCP_SERVER) {
#if ESP_DHCPS
        // if DHCP server configured to set DNS in dhcps API
        if (type != ESP_NETIF_DNS_MAIN) {
            ESP_LOGD(TAG, "set dns invalid type");
            return ESP_ERR_ESP_NETIF_INVALID_PARAMS;
        } else {
            dhcps_dns_setserver(lwip_ip);
        }
#else
        LOG_NETIF_DISABLED_AND_DO("DHCP Server", return ESP_ERR_NOT_SUPPORTED);
#endif
    } else {
        dns_setserver(type, lwip_ip);
    }

and being the root dynamic it means we should set it only when the device is a node

@freakyxue
Copy link
Collaborator

hi @KonssnoK
Please add this patch.

dns.txt

@KonssnoK
Copy link
Contributor Author

im not sure that patch can be used without
espressif/esp-lwip#62

Anyway,
we changed the DHCPS to support also the backup DNS server, not sure if you are planning on adding this feature to 4.4 or not.

@freakyxue
Copy link
Collaborator

hi @KonssnoK
This patch can be used in 4.4. This macro is defined by the customer, not a feature.

@KonssnoK
Copy link
Contributor Author

@freakyxue problem is lwip does not compile if you use FALLBACK_DNS_SERVER_ADDRESS and only IPV4 (see issue above).

Anyway, let us know the plans for DHCPs backup server support, otherwise we will continue using our patch.
Thanks!

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Nov 15, 2023
@KonssnoK
Copy link
Contributor Author

for reference, the issue in lwip has been fixed.
What remains to understand is plans on the DNS Server, which still does not propagate backup DNS.

@zhangyanjiaoesp
Copy link
Collaborator

Will merge the fix ASAP, thanks for the reminder.

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: In Progress Work is in progress labels Feb 5, 2024
hathach pushed a commit to adafruit/esp-idf that referenced this issue Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

5 participants