---
title: llarp::dns::Multi_Platform
summary: a collection of dns platforms that are tried in order when setting dns 

---

# llarp::dns::Multi_Platform



a collection of dns platforms that are tried in order when setting dns 


`#include <platform.hpp>`

Inherits from [llarp::dns::I_Platform](Classes/classllarp_1_1dns_1_1I__Platform.md)

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[~Multi_Platform](Classes/classllarp_1_1dns_1_1Multi__Platform.md#function-~multi-platform)**() override =default |
| void | **[add_impl](Classes/classllarp_1_1dns_1_1Multi__Platform.md#function-add-impl)**(std::unique_ptr< [I_Platform](Classes/classllarp_1_1dns_1_1I__Platform.md) > impl)<br>add a platform to be owned  |
| virtual void | **[set_resolver](Classes/classllarp_1_1dns_1_1Multi__Platform.md#function-set-resolver)**(unsigned int if_index, [llarp::SockAddr](Classes/structllarp_1_1SockAddr.md) dns, bool global) override<br>try all owned platforms to set the resolver, throws if none of them work  |

## Additional inherited members

**Public Functions inherited from [llarp::dns::I_Platform](Classes/classllarp_1_1dns_1_1I__Platform.md)**

|                | Name           |
| -------------- | -------------- |
| virtual | **[~I_Platform](Classes/classllarp_1_1dns_1_1I__Platform.md#function-~i-platform)**() =default |


## Public Functions Documentation

### function ~Multi_Platform

```cpp
~Multi_Platform() override =default
```


### function add_impl

```cpp
void add_impl(
    std::unique_ptr< I_Platform > impl
)
```

add a platform to be owned 

### function set_resolver

```cpp
virtual void set_resolver(
    unsigned int if_index,
    llarp::SockAddr dns,
    bool global
) override
```

try all owned platforms to set the resolver, throws if none of them work 

**Reimplements**: [llarp::dns::I_Platform::set_resolver](Classes/classllarp_1_1dns_1_1I__Platform.md#function-set-resolver)


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

Updated on 2025-03-02 at 05:10:06 +0000