---
title: llarp::dns::Null_Platform
summary: a dns platform does silently does nothing, successfully 

---

# llarp::dns::Null_Platform



a dns platform does silently does nothing, successfully 


`#include <platform.hpp>`

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

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[~Null_Platform](Classes/classllarp_1_1dns_1_1Null__Platform.md#function-~null-platform)**() override =default |
| virtual void | **[set_resolver](Classes/classllarp_1_1dns_1_1Null__Platform.md#function-set-resolver)**(unsigned int if_index, [llarp::SockAddr](Classes/structllarp_1_1SockAddr.md) dns, bool global) override<br>Attempts to set lokinet as the DNS server.  |

## 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 ~Null_Platform

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


### function set_resolver

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

Attempts to set lokinet as the DNS server. 

**Parameters**: 

  * **if_index** &ndash; the interface index to which we add the DNS servers, this can be gotten from the interface name e.g. lokitun0 (Typically tun_endpoint.GetIfName().) and then put through if_nametoindex(). 
  * **dns** &ndash; the listening address of the lokinet DNS server 
  * **global** &ndash; whether to set up lokinet for all DNS queries (true) or just .loki & .snode addresses (false). 


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


throws if unsupported or fails.


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

Updated on 2023-01-23 at 22:05:55 +0000