---
title: llarp::layers::platform::DNSQueryHandler
summary: handles dns queries, for .loki / .snode 

---

# llarp::layers::platform::DNSQueryHandler



handles dns queries, for .loki / .snode 


`#include <dns_bridge.hpp>`

Inherits from [llarp::dns::Resolver_Base](Classes/classllarp_1_1dns_1_1Resolver__Base.md)

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[DNSQueryHandler](Classes/classllarp_1_1layers_1_1platform_1_1DNSQueryHandler.md#function-dnsqueryhandler)**([PlatformLayer](Classes/classllarp_1_1layers_1_1platform_1_1PlatformLayer.md) & parent) |
| | **[~DNSQueryHandler](Classes/classllarp_1_1layers_1_1platform_1_1DNSQueryHandler.md#function-~dnsqueryhandler)**() override =default |

## Additional inherited members

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

|                | Name           |
| -------------- | -------------- |
| virtual | **[~Resolver_Base](Classes/classllarp_1_1dns_1_1Resolver__Base.md#function-~resolver-base)**() =default |
| bool | **[operator<](Classes/classllarp_1_1dns_1_1Resolver__Base.md#function-operator<)**(const [Resolver_Base](Classes/classllarp_1_1dns_1_1Resolver__Base.md) & other) const<br>less than via rank  |
| bool | **[operator>](Classes/classllarp_1_1dns_1_1Resolver__Base.md#function-operator>)**(const [Resolver_Base](Classes/classllarp_1_1dns_1_1Resolver__Base.md) & other) const<br>greater than via rank  |
| virtual std::optional< [SockAddr](Classes/structllarp_1_1SockAddr.md) > | **[GetLocalAddr](Classes/classllarp_1_1dns_1_1Resolver__Base.md#function-getlocaladdr)**() const<br>get local socket address that queries are sent from  |
| virtual std::string_view | **[ResolverName](Classes/classllarp_1_1dns_1_1Resolver__Base.md#function-resolvername)**() const =0<br>get printable name  |
| virtual void | **[ResetResolver](Classes/classllarp_1_1dns_1_1Resolver__Base.md#function-resetresolver)**(] std::optional< std::vector< [SockAddr](Classes/structllarp_1_1SockAddr.md) >> replace_upstream =std::nullopt)<br>reset the resolver state, optionally replace upstream info with new info.  |
| virtual void | **[Down](Classes/classllarp_1_1dns_1_1Resolver__Base.md#function-down)**()<br>cancel all pending requests and cease further operation. Default operation is a no-op.  |
| virtual bool | **[MaybeHookDNS](Classes/classllarp_1_1dns_1_1Resolver__Base.md#function-maybehookdns)**(std::shared_ptr< [PacketSource_Base](Classes/classllarp_1_1dns_1_1PacketSource__Base.md) > source, const [Message](Classes/structllarp_1_1dns_1_1Message.md) & query, const [SockAddr](Classes/structllarp_1_1SockAddr.md) & to, const [SockAddr](Classes/structllarp_1_1SockAddr.md) & from) =0<br>attempt to handle a dns message returns true if we consumed this query and it should not be processed again  |

**Protected Functions inherited from [llarp::dns::Resolver_Base](Classes/classllarp_1_1dns_1_1Resolver__Base.md)**

|                | Name           |
| -------------- | -------------- |
| virtual int | **[Rank](Classes/classllarp_1_1dns_1_1Resolver__Base.md#function-rank)**() const =0<br>return the sorting order for this resolver lower means it will be tried first  |


## Public Functions Documentation

### function DNSQueryHandler

```cpp
DNSQueryHandler(
    PlatformLayer & parent
)
```


### function ~DNSQueryHandler

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


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

Updated on 2023-03-06 at 20:36:34 +0000