pub unsafe extern "C" fn otDnsClientSetDefaultConfig(
    aInstance: *mut otInstance,
    aConfig: *const otDnsQueryConfig
)
Expand description

Sets the default query config on DNS client.

@note Any ongoing query will continue to use the config from when it was started. The new default config will be used for any future DNS queries.

The @p aConfig can be NULL. In this case the default config will be set to the defaults from OT config options OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_{}. This resets the default query config back to to the config when the OpenThread stack starts.

In a non-NULL @p aConfig, caller can choose to leave some of the fields in otDnsQueryConfig instance unspecified (value zero). The unspecified fields are replaced by the corresponding OT config option definitions OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_{} to form the default query config.

When OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_SERVER_ADDRESS_AUTO_SET_ENABLE is enabled, the server’s IPv6 address in the default config is automatically set and updated by DNS client. This is done only when user does not explicitly set or specify it. This behavior requires SRP client and its auto-start feature to be 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.

@param[in] aInstance A pointer to an OpenThread instance. @param[in] aConfig A pointer to the new query config to use as default.