Skip to main content

Module dns

Module dns 

Source
Expand description

DNS-over-HTTPS (DoH) resolver with configurable DNS servers.

This module provides DNS resolution using DNS-over-HTTPS. It can work in two modes:

  1. Direct mode: Uses regular TCP/TLS connections (for use before WireGuard is up)
  2. Tunnel mode: Uses the WireGuard tunnel for DNS queries

Both modes ensure DNS privacy by using encrypted HTTPS connections.

§Configurable DNS Servers

You can configure different DNS servers for:

  • Pre-connection (direct mode): Used before the WireGuard tunnel is established
  • Post-connection (tunnel mode): Used after the tunnel is up, queries go through VPN

By default, Cloudflare DNS (1.1.1.1, 1.0.0.1) is used.

Structs§

DnsConfig
DNS configuration for the library.
DohResolver
A DNS-over-HTTPS resolver with configurable DNS servers.
DohServerConfig
Configuration for a DNS-over-HTTPS server.