# otDnsServiceInfo Struct Reference

# otDnsServiceInfo


`#include <openthread/dns_client.h>`

Provides info for a DNS service instance.

## Summary

| ### Public attributes ||
|---|---|
| `https://openthread.io/reference/struct/ot-dns-service-info#structot_dns_service_info_1a1a3a75658192bdcd80d2d4832833f55a` | `https://openthread.io/reference/struct/ot-ip6-address` The host IPv6 address. Set to all zero if not available. |
| `https://openthread.io/reference/struct/ot-dns-service-info#structot_dns_service_info_1aeb7df867ba5c50dd4872b7d791a070c9` | `uint32_t` The host address TTL. |
| `https://openthread.io/reference/struct/ot-dns-service-info#structot_dns_service_info_1a738909de5da67e911e3071cf281840ab` | `char *` Buffer to output the service host name (can be NULL if not needed). |
| `https://openthread.io/reference/struct/ot-dns-service-info#structot_dns_service_info_1a82016a0701b986483c4765a3da7b412b` | `uint16_t` Size of `mHostNameBuffer`. |
| `https://openthread.io/reference/struct/ot-dns-service-info#structot_dns_service_info_1a0f4119431c8829b625b48182359387ea` | `uint16_t` Service port number. |
| `https://openthread.io/reference/struct/ot-dns-service-info#structot_dns_service_info_1a12c9df8d7afe46b364a31333839d47b5` | `uint16_t` Service priority. |
| `https://openthread.io/reference/struct/ot-dns-service-info#structot_dns_service_info_1a646bedc3f6f5194b0d04ce8a6a52ffef` | `uint32_t` Service record TTL (in seconds). |
| `https://openthread.io/reference/struct/ot-dns-service-info#structot_dns_service_info_1a843ee921900a2dcac0838135d249b621` | `uint8_t *` Buffer to output TXT data (can be NULL if not needed). |
| `https://openthread.io/reference/struct/ot-dns-service-info#structot_dns_service_info_1a54da0cb359f061cd85b8dfbf794cc2e1` | `uint16_t` On input, size of `mTxtData` buffer. On output number bytes written. |
| `https://openthread.io/reference/struct/ot-dns-service-info#structot_dns_service_info_1a51c59a7bc44d3ed78cecd661ae2f1a86` | `bool` Indicates if TXT data could not fit in `mTxtDataSize` and was truncated. |
| `https://openthread.io/reference/struct/ot-dns-service-info#structot_dns_service_info_1a7f9eb5c98c259429fd9dd8f316a22dd5` | `uint32_t` The TXT data TTL. |
| `https://openthread.io/reference/struct/ot-dns-service-info#structot_dns_service_info_1aad8bad7aa8438f6d2a0a9db61d37d91e` | `uint16_t` Service weight. |

## Public attributes

### mHostAddress

```
otIp6Address otDnsServiceInfo::mHostAddress
```
The host IPv6 address. Set to all zero if not available.

### mHostAddressTtl

```
uint32_t otDnsServiceInfo::mHostAddressTtl
```
The host address TTL.

### mHostNameBuffer

```
char * otDnsServiceInfo::mHostNameBuffer
```
Buffer to output the service host name (can be NULL if not needed).

### mHostNameBufferSize

```
uint16_t otDnsServiceInfo::mHostNameBufferSize
```
Size of `mHostNameBuffer`.

### mPort

```
uint16_t otDnsServiceInfo::mPort
```
Service port number.

### mPriority

```
uint16_t otDnsServiceInfo::mPriority
```
Service priority.

### mTtl

```
uint32_t otDnsServiceInfo::mTtl
```
Service record TTL (in seconds).

### mTxtData

```
uint8_t * otDnsServiceInfo::mTxtData
```
Buffer to output TXT data (can be NULL if not needed).

### mTxtDataSize

```
uint16_t otDnsServiceInfo::mTxtDataSize
```
On input, size of `mTxtData` buffer. On output number bytes written.

### mTxtDataTruncated

```
bool otDnsServiceInfo::mTxtDataTruncated
```
Indicates if TXT data could not fit in `mTxtDataSize` and was truncated.

### mTxtDataTtl

```
uint32_t otDnsServiceInfo::mTxtDataTtl
```
The TXT data TTL.

### mWeight

```
uint16_t otDnsServiceInfo::mWeight
```
Service weight.

## 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).