-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.toml
57 lines (45 loc) · 1.23 KB
/
config.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
[global]
nameservers = ["223.5.5.5", "223.6.6.6"]
[server]
listen = "0.0.0.0:5454"
cache_size = 5000
[filters.alidns]
kind = "proxyby"
props.servers = ["223.5.5.5", "223.6.6.6"]
[filters.cloudflare]
kind = "proxyby"
props.servers = ["doh://1.1.1.1"]
[filters.opendns]
kind = "proxyby"
props.servers = ["tcp://208.67.222.222:443", "tcp://208.67.220.220:443"]
[filters.chinadns]
kind = "chinadns"
props.trusted = ["doh://dns.google", "dot://dot.pub"]
props.mistrusted = ["223.5.5.5", "223.6.6.6"]
props.geoip_database = "GeoLite2-Country.mmdb"
[filters.custom]
kind = "hosts"
props.hosts = { "127.0.0.1" = "localhost", "::1" = "localhost", "1.1.1.1" = "one.one.one.one", "223.5.5.5" = "dns.alidns.com" }
[filters.lua]
kind = "lua"
props.script = """
-- The filter entrance:
function handle(ctx)
-- log something...
for i,v in ipairs(ctx.request:questions()) do
logger:info('---- question#'..i..': '..v.name)
end
-- resolve addr from 223.5.5.5
local resp = resolve(ctx.request,'223.5.5.5')
-- log something...
for i,v in ipairs(resp:answers()) do
logger:info('---- answers#'..i..': name='..v.name..', rdata='..v.rdata)
end
-- answer it!
ctx:nocache()
ctx:answer(resp)
end
"""
[[rules]]
domain = "*"
filters = ["alidns"]