1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# dnsproxy Example Configuration
# All available configuration options with explanations
# Log level: trace, debug, info, warn, error
= "info"
# DNS Bootstrap resolvers
# Used to resolve domain names of upstreams and SOCKS5 proxy addresses.
# If empty, the system resolver will be used.
= [
"1.1.1.1",
"9.9.9.9",
"223.5.5.5",
"114.114.114.114",
"8.8.8.8:53"
]
# Listen addresses (can specify multiple). Defaults to 127.0.0.1
= ["127.0.0.1"]
# listen_addrs = ["0.0.0.0"] # IPv4 all interfaces
# listen_addrs = ["::"] # IPv4 + IPv6 all interfaces
# Listen ports (can specify multiple). Defaults to 53
= [53000]
# Upstream resolution strategy:
# - "parallel": Query all upstreams concurrently, returning the fastest valid response (default)
# - "round_robin" (or "load_balance"): Cycle through upstreams with failover
= "parallel"
# Upstream query timeout (e.g. "5s", "10s", "500ms")
= "10s"
# Upstream DNS servers
# Supported protocols:
# - DNS-over-HTTPS (DoH): https://...
# - Plain UDP DNS: 1.1.1.1, 8.8.8.8:53, udp://9.9.9.9:53, or domain names
# - SOCKS5 proxy routing: configure inline table with socks5 URL and optional credentials
= [
# Cloudflare DoH
"https://1.1.1.1/dns-query",
# Quad9 DoH
"https://9.9.9.9/dns-query",
# Google DoH
"https://8.8.8.8/dns-query",
# Plain UDP upstream
# "udp://1.0.0.1:53",
# DoH via SOCKS5 proxy:
# { url = "https://8.8.4.4/dns-query", socks5 = "socks5://127.0.0.1:1080" },
# DoH via authenticated SOCKS5 proxy:
# { url = "https://8.8.4.4/dns-query", socks5 = "socks5://127.0.0.1:1080", username = "user", password = "password" },
]
# Cache configuration
= true
# Path to disk cache file for persistence across restarts.
# If unset or commented out, caching remains in RAM only.
= "/tmp/dnsproxy-cache.toml"
# Maximum cache memory/disk size limit (e.g. "50M", "100MB", "1G")
= "50M"
# Maximum cache TTL retention period (e.g. "1d", "12h", "1d1h1m1s").
# Records with lower DNS TTL will respect their DNS TTL.
= "1d"
# Rate limiter: maximum concurrent queries (0 to disable)
= 0
# IPv6 (AAAA) filtering:
# When true, AAAA records are stripped from responses unless domain matches whitelist
= false
# Whitelist domains to retain AAAA records when ipv6_disabled = true. Supports wildcards.
= [
"example.org",
"*.example.com",
]