---
title: llarp::layers::platform::DNSZone
summary: synthesizes authoritative RR for a .loki or .snode address. 

---

# llarp::layers::platform::DNSZone



synthesizes authoritative RR for a .loki or .snode address. 


`#include <dns_bridge.hpp>`

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[DNSZone](Classes/classllarp_1_1layers_1_1platform_1_1DNSZone.md#function-dnszone)**() =default |
| | **[DNSZone](Classes/classllarp_1_1layers_1_1platform_1_1DNSZone.md#function-dnszone)**(const [AddrMapper](Classes/classllarp_1_1layers_1_1platform_1_1AddrMapper.md) & mapper, [flow::FlowAddr](Classes/classllarp_1_1layers_1_1flow_1_1FlowAddr.md) addr)<br>takes out zone info from an address mapper for a flow address addr.  |
| std::vector< [dns::RData](Classes/classllarp_1_1dns_1_1RData.md) > | **[srv_records](Classes/classllarp_1_1layers_1_1platform_1_1DNSZone.md#function-srv-records)**() const<br>synth srv records rdata.  |
| std::vector< [dns::RData](Classes/classllarp_1_1dns_1_1RData.md) > | **[cname_records](Classes/classllarp_1_1layers_1_1platform_1_1DNSZone.md#function-cname-records)**() const<br>synth cname records rdata.  |
| uint32_t | **[ttl](Classes/classllarp_1_1layers_1_1platform_1_1DNSZone.md#function-ttl)**(dns::RRType rr_type) const<br>get ttl for a rr type.  |
| std::string | **[zone_name](Classes/classllarp_1_1layers_1_1platform_1_1DNSZone.md#function-zone-name)**() const<br>the root dns name of this zone, basically just the flow address encoded for dns.  |
| constexpr const [AddrMapper](Classes/classllarp_1_1layers_1_1platform_1_1AddrMapper.md) & | **[addr_mapper](Classes/classllarp_1_1layers_1_1platform_1_1DNSZone.md#function-addr-mapper)**() const |
| void | **[add_srv_record](Classes/classllarp_1_1layers_1_1platform_1_1DNSZone.md#function-add-srv-record)**(dns::SRVTuple record)<br>add a new srv recrod to this dns zone.  |
| std::vector< [dns::ResourceRecord](Classes/classllarp_1_1dns_1_1ResourceRecord.md) > | **[synth_rr_for](Classes/classllarp_1_1layers_1_1platform_1_1DNSZone.md#function-synth-rr-for)**(dns::RRType r_type) const<br>synthesize any resource records for a rr type.  |

## Public Functions Documentation

### function DNSZone

```cpp
DNSZone() =default
```


### function DNSZone

```cpp
DNSZone(
    const AddrMapper & mapper,
    flow::FlowAddr addr
)
```

takes out zone info from an address mapper for a flow address addr. 

### function srv_records

```cpp
std::vector< dns::RData > srv_records() const
```

synth srv records rdata. 

### function cname_records

```cpp
std::vector< dns::RData > cname_records() const
```

synth cname records rdata. 

### function ttl

```cpp
uint32_t ttl(
    dns::RRType rr_type
) const
```

get ttl for a rr type. 

### function zone_name

```cpp
std::string zone_name() const
```

the root dns name of this zone, basically just the flow address encoded for dns. 

### function addr_mapper

```cpp
inline constexpr const AddrMapper & addr_mapper() const
```


### function add_srv_record

```cpp
void add_srv_record(
    dns::SRVTuple record
)
```

add a new srv recrod to this dns zone. 

### function synth_rr_for

```cpp
std::vector< dns::ResourceRecord > synth_rr_for(
    dns::RRType r_type
) const
```

synthesize any resource records for a rr type. 

-------------------------------

Updated on 2023-04-27 at 04:17:17 +0000