-
Notifications
You must be signed in to change notification settings - Fork 41
/
dns.example.conf
106 lines (94 loc) · 2.92 KB
/
dns.example.conf
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// The settings in this example will generate the following V2Ray JSON config:
//
// "dns": {
// "servers": [
// {
// "address": "223.5.5.5",
// "port": 53,
// "domains": [
// "domain:toutiao.com",
// "geosite:cn"
// ]
// },
// "114.114.114.114",
// {
// "address": "8.8.8.8",
// "port": 53,
// "domains": [
// "domain:fbcdn.net"
// ]
// },
// "8.8.4.4"
// ],
// "hosts": {
// "localhost": "127.0.0.1",
// "abcd.com": "1.2.3.4"
// },
// "clientIp": "115.239.211.92"
// }
//
// Note that for DNS requests actually send to the desired targets, you are
// responsible to correctly configure routing rules for them. For example,
// you may want to send DNS requests to 8.8.8.8,8.8.4.4 through the proxy server,
// and send DNS requests to 223.5.5.5,114.114.114.114 directly, then you may need
// the following routing rules:
//
// "routing": {
// "domainStrategy": "IPIfNonMatch",
// "rules": [
// {
// "type": "field",
// "ip": [
// "223.5.5.5",
// "114.114.114.114"
// ],
// "outboundTag": "direct"
// },
// {
// "type": "field",
// "ip": [
// "8.8.8.8",
// "8.8.4.4"
// ],
// "outboundTag": "proxy"
// }
// ]
// }
//
// Where "direct" is the tag name of the freedom outbound, "proxy" is the tag name
// of your proxy server outbound.
// Section names such as "DnsServer", "DnsRule" are all case-insensitive.
// All empty lines and whitespaces will be omitted, comment lines are
// start with `//`, inline comments are start with `#`, all characters
// after `#` will be treated as comments.
[DnsServer]
// Format: address,port,tag
//
// `tag` is a unique alphanumeric string for each DNS server, it's used for
// identifying DNS servers by DNS domain rules, it's case-insensitive. `tag`s are
// only help in the configuration parsing procedure, and won't be used elsewhere.
//
// `port` and `tag` could be omitted, means that using the default 53 port
// and no DNS rules attach to that DNS server.
223.5.5.5,53,DIRECT
114.114.114.114
8.8.8.8,53,REMOTE
8.8.4.4
[DnsRule]
// DNS requests for domain names which match these rules will send to the DNS
// server with the corresponding tag name first, i.e. DNS server with the matched
// tag has the highest priority. Note that for these rules to take effects,
// `domainStrategy` in routing must be correctly configured.
DOMAIN-SUFFIX,toutiao.com,DIRECT
DOMAIN-KEYWORD,geosite:cn,DIRECT
DOMAIN-SUFFIX,fbcdn.net,REMOTE
[DnsHost]
// Static DNS map that functions in the same way as /etc/hosts.
localhost=127.0.0.1
abcd.com=1.2.3.4
[DnsClientIp]
// Client IP for EDNS Client Subnet extension, a single IP address.
115.239.211.92
[RoutingDomainStrategy]
// https://www.v2ray.com/chapter_02/03_routing.html
IPIfNonMatch