-
Notifications
You must be signed in to change notification settings - Fork 15
/
dnsmasq_regex_example.conf
42 lines (33 loc) · 1.14 KB
/
dnsmasq_regex_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
# listening DNS port
port=30000
# do not read /etc/resolv.conf at all
no-resolv
# do not re-read /etc/resolv.conf when file was changed by ISP
no-poll
# default upstream dns server
server=114.114.114.114
# regex server examples
server=/:.*github.*:/8.8.8.8
server=/:.*google.*:/8.8.8.8
server=/:.*youtube.*:/8.8.8.8
# normal server examples
server=/fb.me/8.8.8.8
server=/163.com/223.5.5.5
# regex address examples, match 'xxx.qq.com' and 'xxx.q.com'
address=/:\.q{1,2}\.com$:/127.0.0.1
# normal address examples
address=/localhost.com/127.0.0.1
# ipset examples
# Tips: You need to manually create ipset 'test' first:
# sudo ipset create test hash:ip
# and run dnsmasq with root(to modify this set)
ipset=/fb.me/test
ipset=/:.*google.*:/test
# nftables examples
# Tips: You need to manually create nftables ip set 'google-ipset' first:
# sudo nft add table dnsmasq-table
# sudo nft add set ip dnsmasq-table google-ipset { type ipv4_addr \; }
# sudo nft add element ip dnsmasq-table google-ipset { 8.8.8.8 }
# and run dnsmasq with root(to modify this set)
nftset=/gvt0.com/ip#dnsmasq-table#google-ipset
nftset=/:.*youtube.*:/ip#dnsmasq-table#google-ipset