mirror of
https://github.com/espressif/openthread.git
synced 2026-07-10 14:20:29 +00:00
05d8e81988
This commit adds a new mechanism in `Dns::Client` along with a new public OT API `otDnsClientResolveIp4Address()` and its related CLI sub-command to allow a user to request an address resolution DNS query specifically for A records or IPv4 addresses for a given host name. This API requires `OPENTHREAD_CONFIG_DNS_CLIENT_NAT64_ENABLE` to be enabled. Upon receiving a successful query response the addresses are reported to user (in callback) as NAT64 IPv6 translated version of the IPv4 addresses from the received query response. The new API is added in addition to the existing behavior where address resolution query from `otDnsClientResolveAddress()` first queries for IPv6 addresses and only if no IPv6 address is found and NAT64 is enabled and allowed by the query config, `Dns::Client` implementation tries to perform an IPv4 query. The new API directly starts with IPv4 query and can be useful in situations where Thread devices are connected through BRs to a network without global IPv6 connectivity.