DNS Client

This module includes configuration variables for the DNS client.

Summary

Macros

OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_MAX_TX_ATTEMPTS 3
Specifies the default maximum number of DNS query tx attempts with no response before reporting failure.
OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_NAT64_ALLOWED 1
Specifies the default NAT64 mode, i.e., whether to allow or disallow NAT64 address translation during DNS client address resolution.
OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_RECURSION_DESIRED_FLAG 1
OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_RESPONSE_TIMEOUT 6000
Specifies the default wait time that DNS client waits for a response from server (in milliseconds).
OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_SERVER_ADDRESS_AUTO_SET_ENABLE (OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE && OPENTHREAD_CONFIG_SRP_CLIENT_AUTO_START_API_ENABLE)
Set to 1 for DNS client to automatically set and update the server IPv6 address in the default config (when it is not explicitly set by user).
OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_SERVER_IP6_ADDRESS "2001:4860:4860::8888"
Specifies the default DNS server IPv6 address.
OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_SERVER_PORT 53
Specifies the default DNS server port number.
OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_SERVICE_MODE OT_DNS_SERVICE_MODE_SRV_TXT_OPTIMIZE
Specifies the default otDnsServiceMode to use.
OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 0
Define to 1 to enable DNS Client support.
OPENTHREAD_CONFIG_DNS_CLIENT_NAT64_ENABLE 1
Define to 1 to enable support for NAT64 address translation (from IPv4 to IPv6) during address resolution by DNS client.
OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE 0
Enables support for sending DNS Queries over TCP.
OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_QUERY_MAX_SIZE 1024
Specifies size of receive and transmit buffers of TCP sockets for DNS query over TCP.
OPENTHREAD_CONFIG_DNS_CLIENT_SERVICE_DISCOVERY_ENABLE 1
Define to 1 to enable DNS based Service Discovery (DNS-SD) client.

Macros

OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_MAX_TX_ATTEMPTS

 OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_MAX_TX_ATTEMPTS 3

Specifies the default maximum number of DNS query tx attempts with no response before reporting failure.

OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_NAT64_ALLOWED

 OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_NAT64_ALLOWED 1

Specifies the default NAT64 mode, i.e., whether to allow or disallow NAT64 address translation during DNS client address resolution.

This mode is only available when OPENTHREAD_CONFIG_DNS_CLIENT_NAT64_ENABLE is enabled.

OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_RECURSION_DESIRED_FLAG

 OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_RECURSION_DESIRED_FLAG 1

OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_RESPONSE_TIMEOUT

 OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_RESPONSE_TIMEOUT 6000

Specifies the default wait time that DNS client waits for a response from server (in milliseconds).

OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_SERVER_ADDRESS_AUTO_SET_ENABLE

 OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_SERVER_ADDRESS_AUTO_SET_ENABLE (OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE && OPENTHREAD_CONFIG_SRP_CLIENT_AUTO_START_API_ENABLE)

Set to 1 for DNS client to automatically set and update the server IPv6 address in the default config (when it is not explicitly set by user).

This feature requires SRP client and its auto-start feature to be also enabled. SRP client will then monitor the Thread Network Data for DNS/SRP Service entries to select an SRP server. The selected SRP server address is also set as the DNS server address in the default config.

OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_SERVER_IP6_ADDRESS

 OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_SERVER_IP6_ADDRESS "2001:4860:4860::8888"

Specifies the default DNS server IPv6 address.

It MUST be a C string representation of the server IPv6 address.

Default value is set to "2001:4860:4860::8888" which is the Google Public DNS IPv6 address.

OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_SERVER_PORT

 OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_SERVER_PORT 53

Specifies the default DNS server port number.

OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_SERVICE_MODE

 OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_SERVICE_MODE OT_DNS_SERVICE_MODE_SRV_TXT_OPTIMIZE

Specifies the default otDnsServiceMode to use.

The value MUST be from otDnsServiceMode enumeration.

OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE

 OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 0

Define to 1 to enable DNS Client support.

OPENTHREAD_CONFIG_DNS_CLIENT_NAT64_ENABLE

 OPENTHREAD_CONFIG_DNS_CLIENT_NAT64_ENABLE 1

Define to 1 to enable support for NAT64 address translation (from IPv4 to IPv6) during address resolution by DNS client.

OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE

 OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE 0

Enables support for sending DNS Queries over TCP.

OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_QUERY_MAX_SIZE

 OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_QUERY_MAX_SIZE 1024

Specifies size of receive and transmit buffers of TCP sockets for DNS query over TCP.

OPENTHREAD_CONFIG_DNS_CLIENT_SERVICE_DISCOVERY_ENABLE

 OPENTHREAD_CONFIG_DNS_CLIENT_SERVICE_DISCOVERY_ENABLE 1

Define to 1 to enable DNS based Service Discovery (DNS-SD) client.

Resources

OpenThread API Reference topics originate from the source code, available on GitHub. For more information, or to contribute to our documentation, refer to Resources.