---
title: llarp::dns::IQueryHandler
summary: handler of dns query hooking 

---

# llarp::dns::IQueryHandler



handler of dns query hooking 


`#include <server.hpp>`

Inherited by [llarp::handlers::ExitEndpoint](Classes/structllarp_1_1handlers_1_1ExitEndpoint.md), [llarp::handlers::TunEndpoint](Classes/structllarp_1_1handlers_1_1TunEndpoint.md)

## Public Functions

|                | Name           |
| -------------- | -------------- |
| virtual | **[~IQueryHandler](Classes/classllarp_1_1dns_1_1IQueryHandler.md#function-~iqueryhandler)**() =default |
| virtual bool | **[ShouldHookDNSMessage](Classes/classllarp_1_1dns_1_1IQueryHandler.md#function-shouldhookdnsmessage)**(const [Message](Classes/structllarp_1_1dns_1_1Message.md) & msg) const =0<br>return true if we should hook this message  |
| virtual bool | **[HandleHookedDNSMessage](Classes/classllarp_1_1dns_1_1IQueryHandler.md#function-handlehookeddnsmessage)**([Message](Classes/structllarp_1_1dns_1_1Message.md) query, std::function< void([Message](Classes/structllarp_1_1dns_1_1Message.md))> sendReply) =0<br>handle a hooked message  |

## Public Functions Documentation

### function ~IQueryHandler

```cpp
virtual ~IQueryHandler() =default
```


### function ShouldHookDNSMessage

```cpp
virtual bool ShouldHookDNSMessage(
    const Message & msg
) const =0
```

return true if we should hook this message 

**Reimplemented by**: [llarp::handlers::ExitEndpoint::ShouldHookDNSMessage](Classes/structllarp_1_1handlers_1_1ExitEndpoint.md#function-shouldhookdnsmessage), [llarp::handlers::TunEndpoint::ShouldHookDNSMessage](Classes/structllarp_1_1handlers_1_1TunEndpoint.md#function-shouldhookdnsmessage)


### function HandleHookedDNSMessage

```cpp
virtual bool HandleHookedDNSMessage(
    Message query,
    std::function< void(Message)> sendReply
) =0
```

handle a hooked message 

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

Updated on 2022-08-30 at 18:09:27 +0000