forked from folbricht/routedns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
use-case-4.toml
62 lines (51 loc) · 1.61 KB
/
use-case-4.toml
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
# This config shows how to deal with multiple VPNs having their own DNS. It
# supports modifying queries for short hostnames such as prod-server1 into
# queries for server1.prod-domain.com and are routint to the correct DNS server.
# Lab DNS servers. Define both UDP and TCP, with TCP only used when responses
# are truncated.
[resolvers.prod-dns-udp]
address = "10.1.1.1:53"
protocol = "udp"
[resolvers.prod-dns-tcp]
address = "10.1.1.1:53"
protocol = "tcp"
[resolvers.test-dns-udp]
address = "10.2.1.1:53"
protocol = "udp"
[resolvers.test-dns-tcp]
address = "10.2.1.1:53"
protocol = "tcp"
# Try UDP first, if truncated use the alernative TCP one
[groups.prod-dns]
type = "truncate-retry"
resolvers = ["prod-dns-udp"]
retry-resolver = "prod-dns-tcp"
[groups.test-dns]
type = "truncate-retry"
resolvers = ["test-dns-udp"]
retry-resolver = "test-dns-tcp"
# Standard Cloudflare DoT, used for everything not destined to the lab
[resolvers.cloudflare-dot]
address = "1.1.1.1:853"
protocol = "dot"
[routers.router1]
routes = [
{ name = '(^|\.)prod-domain\.com\.$', resolver="prod-dns" }, # Prod VPN
{ name = '(^|\.)test-domain\.com\.$', resolver="test-dns" }, # Test VPN
{ resolver="cloudflare-dot" }, # Everything else
]
[groups.append-domain]
type = "replace"
resolvers = ["router1"]
replace = [
{ from = '^prod-([^.]+\.)$', to = '${1}prod-domain.com.' },
{ from = '^test-([^.]+\.)$', to = '${1}test-domain.com.' },
]
[listeners.local-udp]
address = "127.0.0.1:53"
protocol = "udp"
resolver = "append-domain"
[listeners.local-tcp]
address = "127.0.0.1:53"
protocol = "tcp"
resolver = "append-domain"