# Multicast DNS

# Multicast DNS

This module includes configuration variables for the Multicast DNS (mDNS).

## Summary

| ### Macros ||
|---|---|
| `https://openthread.io/reference/config/group/config-mdns#group__config-mdns_1ga07d8eb0add4326fad662acb674455dd6 0` | Defines the default run-time state of mDNS verbose logging (turned on/off) on startup. |
| `https://openthread.io/reference/config/group/config-mdns#group__config-mdns_1gaa4124b44b2249a068980c6399b2daafd OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE` | Define to 1 for mDNS module to be automatically enabled/disabled on the same infra-if used for border routing based on infra-if state. |
| `https://openthread.io/reference/config/group/config-mdns#group__config-mdns_1gab09092166df5ad67ed6512ec47a7ee24 1` | Specified the default value for `otMdnsIsQuestionUnicastAllowed()` which indicates whether mDNS core is allowed to send "QU" questions (questions requesting unicast response). |
| `https://openthread.io/reference/config/group/config-mdns#group__config-mdns_1gad986f87f3ee23fd9cb1ad0699612d7e9 0` | Define to 1 to enable Multicast DNS (mDNS) support. |
| `https://openthread.io/reference/config/group/config-mdns#group__config-mdns_1ga854df7cd34a0865c6eaa3d2907c30c61 OPENTHREAD_CONFIG_MULTICAST_DNS_PUBLIC_API_ENABLE` | Define to 1 for mDNS module to provide mechanisms and public APIs to iterate over registered host, service, and key entries, as well as browsers and resolvers. |
| `https://openthread.io/reference/config/group/config-mdns#group__config-mdns_1gae340c2164b0676e313ef822750d728ad 0` | Define to 1 to add mock (empty) implementation of mDNS platform APIs. |
| `https://openthread.io/reference/config/group/config-mdns#group__config-mdns_1ga22244721490b68d87267552d610c5346 1` | Specifies the behavior of the mDNS module when a late conflict is detected. |
| `https://openthread.io/reference/config/group/config-mdns#group__config-mdns_1ga6f72cf97634788023341a2cc244ee379 0` | Define to 1 to allow public OpenThread APIs to be defined for Multicast DNS (mDNS) module. |
| `https://openthread.io/reference/config/group/config-mdns#group__config-mdns_1ga6656e8a135f3e11d080f72aa43a963f0 0` | Define as 1 to enable the multicast DNS (mDNS) verbose logging feature at build-time. |

## Macros

### OPENTHREAD_CONFIG_MULTICAST_DEFAULT_DNS_VERBOSE_LOGGING_STATE

```
 OPENTHREAD_CONFIG_MULTICAST_DEFAULT_DNS_VERBOSE_LOGGING_STATE 0
```
Defines the default run-time state of mDNS verbose logging (turned on/off) on startup.

This applies only when `OPENTHREAD_CONFIG_MULTICAST_DNS_VERBOSE_LOGGING_ENABLE` is enabled. Set to 1 to turn on verbose logging by default on startup, or 0 to turn it off.

### OPENTHREAD_CONFIG_MULTICAST_DNS_AUTO_ENABLE_ON_INFRA_IF

```
 OPENTHREAD_CONFIG_MULTICAST_DNS_AUTO_ENABLE_ON_INFRA_IF OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE
```
Define to 1 for mDNS module to be automatically enabled/disabled on the same infra-if used for border routing based on infra-if state.

### OPENTHREAD_CONFIG_MULTICAST_DNS_DEFAULT_QUESTION_UNICAST_ALLOWED

```
 OPENTHREAD_CONFIG_MULTICAST_DNS_DEFAULT_QUESTION_UNICAST_ALLOWED 1
```
Specified the default value for `otMdnsIsQuestionUnicastAllowed()` which indicates whether mDNS core is allowed to send "QU" questions (questions requesting unicast response).

When allowed, the first probe will be sent as "QU" question. The `otMdnsSetQuestionUnicastAllowed()` can be used to change the default value at run-time.

### OPENTHREAD_CONFIG_MULTICAST_DNS_ENABLE

```
 OPENTHREAD_CONFIG_MULTICAST_DNS_ENABLE 0
```
Define to 1 to enable Multicast DNS (mDNS) support.

### OPENTHREAD_CONFIG_MULTICAST_DNS_ENTRY_ITERATION_API_ENABLE

```
 OPENTHREAD_CONFIG_MULTICAST_DNS_ENTRY_ITERATION_API_ENABLE OPENTHREAD_CONFIG_MULTICAST_DNS_PUBLIC_API_ENABLE
```
Define to 1 for mDNS module to provide mechanisms and public APIs to iterate over registered host, service, and key entries, as well as browsers and resolvers.

### OPENTHREAD_CONFIG_MULTICAST_DNS_MOCK_PLAT_APIS_ENABLE

```
 OPENTHREAD_CONFIG_MULTICAST_DNS_MOCK_PLAT_APIS_ENABLE 0
```
Define to 1 to add mock (empty) implementation of mDNS platform APIs.

This is intended for generating code size report only and should not be used otherwise.

### OPENTHREAD_CONFIG_MULTICAST_DNS_PERSIST_STATE_ON_POST_PROBE_CONFLICT

```
 OPENTHREAD_CONFIG_MULTICAST_DNS_PERSIST_STATE_ON_POST_PROBE_CONFLICT 1
```
Specifies the behavior of the mDNS module when a late conflict is detected.

A late conflict occurs after a name has been successfully probed and claimed (post-probe). When enabled, the mDNS module will continue advertising/answering for the claimed name. The device essentially prioritizes the stability of the established advertisement. When disabled the mDNS module will transition the entry to the "conflict" state and stop answering/advertising for the name. Regardless of this configuration, the conflict callback is still invoked, informing other modules (such as the module that requested the registration) so they can decide on a higher-level resolution action.

This configuration is enabled by default, especially in Thread use cases like the SRP Advertising Proxy. This is because post-probe conflicts are often transient or benign in these environments. Since the device (acting as the SRP Server) has already accepted an SRP registration from a remote Thread Node (SRP client), it is desirable for the mDNS advertisement to mirror the SRP registered service and maintain its discoverability.

### OPENTHREAD_CONFIG_MULTICAST_DNS_PUBLIC_API_ENABLE

```
 OPENTHREAD_CONFIG_MULTICAST_DNS_PUBLIC_API_ENABLE 0
```
Define to 1 to allow public OpenThread APIs to be defined for Multicast DNS (mDNS) module.

The OpenThread mDNS module is mainly intended for use by other OT core modules, so the public APIs are by default not provided.

### OPENTHREAD_CONFIG_MULTICAST_DNS_VERBOSE_LOGGING_ENABLE

```
 OPENTHREAD_CONFIG_MULTICAST_DNS_VERBOSE_LOGGING_ENABLE 0
```
Define as 1 to enable the multicast DNS (mDNS) verbose logging feature at build-time.

When this feature is enabled, verbose logging can be dynamically turned on or off at run-time using `otMdnsSetVerboseLoggingEnabled()`.

When disabled, the verbose logging code is not included in the build, which reduces code size.

## Resources

OpenThread API Reference topics originate from the source code, available
on [GitHub](https://github.com/openthread/openthread/tree/main/include/openthread).
For more information, or to contribute to our documentation, refer to
[Resources](https://openthread.io/resources).