0%

使用overture搭建DNS无污染递归服务器 可设置Host过滤广告

overture开源项目:https://github.com/shawn1m/overture overture是一个DNS服务程序,RainDNS也是采用这款程序搭建的,最大的特点就是小巧、快速,支持Linux和Windows环境,且是开源项目放心安全,可以用来搭建企业DNS服务。 overture工作配置流程

overture工作配置流程

下载overture

前往Github下载: https://github.com/shawn1m/overture/releases 由于我的系统是Centos7 64位的,所以我下载了overture-linux-amd64.zip

释放overture

1
unzip -d /usr/local/overture overture-linux-amd64.zip

修改config.json

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
{
"BindAddress": ":53",
"PrimaryDNS": [
{
"Name": "RainDNS",
"Address": "119.28.28.28:53",
"Protocol": "udp",
"SOCKS5Address": "",
"Timeout": 6,
"EDNSClientSubnet": {
"Policy": "auto",
"ExternalIP": ""
}
}
],
"AlternativeDNS": [
{
"Name": "RainPOd",
"Address": "119.29.29.29:53",
"Protocol": "udp",
"SOCKS5Address": "",
"Timeout": 6,
"EDNSClientSubnet": {
"Policy": "auto",
"ExternalIP": ""
}
}
],
"OnlyPrimaryDNS": false,
"RedirectIPv6Record": false,
"IPNetworkFile": "./ip_network_sample",
"DomainFile": "./domain_sample",
"DomainBase64Decode": true,
"HostsFile": "./hosts_sample",
"MinimumTTL": 0,
"CacheSize" : 0,
"RejectQtype": [255]
}

【BindAddress】DNS端口,默认为53 【PrimaryDNS】主DNS 其他配置信息可以阅读overture的Github底部

修改防火墙

1
2
3
firewall-cmd --permanent --add-port=53/udp
firewall-cmd --permanent --add-port=53/tcp
firewall-cmd --reload

配置开机启动 vi /etc/systemd/system/overture.service

1
2
3
4
5
6
7
8
[Unit]
Description=overture
After=network.target
[Service]
ExecStart=/usr/local/overture/overture-linux-amd64 -c /usr/local/overture/config.json
Restart=on-abort
[Install]
WantedBy=multi-user.target

启动overture

1
2
systemctl enable overture
systemctl start overture

好了,DNS服务器已经搭建好了!

转载:https://www.iprain.cn/archives/79.html