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

/ 0评 / 0

 

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

overture工作配置流程

下载overture

前往Github下载:

由于我的系统是Centos7 64位的,所以我下载了overture-linux-amd64.zip

释放overture

<span class="hljs-attribute">unzip</span> -d /usr/local/overture overture-linux-amd64.zip

修改config.json

{
  <span class="hljs-attr">"BindAddress"</span>: <span class="hljs-string">":53"</span>,
  <span class="hljs-attr">"PrimaryDNS"</span>: [
    {
      <span class="hljs-attr">"Name"</span>: <span class="hljs-string">"RainDNS"</span>,
      <span class="hljs-attr">"Address"</span>: <span class="hljs-string">"119.28.28.28:53"</span>,
      <span class="hljs-attr">"Protocol"</span>: <span class="hljs-string">"udp"</span>,
      <span class="hljs-attr">"SOCKS5Address"</span>: <span class="hljs-string">""</span>,
      <span class="hljs-attr">"Timeout"</span>: <span class="hljs-number">6</span>,
      <span class="hljs-attr">"EDNSClientSubnet"</span>: {
        <span class="hljs-attr">"Policy"</span>: <span class="hljs-string">"auto"</span>,
        <span class="hljs-attr">"ExternalIP"</span>: <span class="hljs-string">""</span>
      }
    }
  ],
  <span class="hljs-attr">"AlternativeDNS"</span>: [
    {
      <span class="hljs-attr">"Name"</span>: <span class="hljs-string">"RainPOd"</span>,
      <span class="hljs-attr">"Address"</span>: <span class="hljs-string">"119.29.29.29:53"</span>,
      <span class="hljs-attr">"Protocol"</span>: <span class="hljs-string">"udp"</span>,
      <span class="hljs-attr">"SOCKS5Address"</span>: <span class="hljs-string">""</span>,
      <span class="hljs-attr">"Timeout"</span>: <span class="hljs-number">6</span>,
      <span class="hljs-attr">"EDNSClientSubnet"</span>: {
        <span class="hljs-attr">"Policy"</span>: <span class="hljs-string">"auto"</span>,
        <span class="hljs-attr">"ExternalIP"</span>: <span class="hljs-string">""</span>
      }
    }
  ],
  <span class="hljs-attr">"OnlyPrimaryDNS"</span>: <span class="hljs-literal">false</span>,
  <span class="hljs-attr">"RedirectIPv6Record"</span>: <span class="hljs-literal">false</span>,
  <span class="hljs-attr">"IPNetworkFile"</span>: <span class="hljs-string">"./ip_network_sample"</span>,
  <span class="hljs-attr">"DomainFile"</span>: <span class="hljs-string">"./domain_sample"</span>,
  <span class="hljs-attr">"DomainBase64Decode"</span>: <span class="hljs-literal">true</span>,
  <span class="hljs-attr">"HostsFile"</span>: <span class="hljs-string">"./hosts_sample"</span>,
  <span class="hljs-attr">"MinimumTTL"</span>: <span class="hljs-number">0</span>,
  <span class="hljs-attr">"CacheSize"</span> : <span class="hljs-number">0</span>,
  <span class="hljs-attr">"RejectQtype"</span>: [<span class="hljs-number">255</span>]
}

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

修改防火墙

firewall-cmd <span class="hljs-comment">--permanent --add-port=53/udp</span>
firewall-cmd <span class="hljs-comment">--permanent --add-port=53/tcp</span>
firewall-cmd <span class="hljs-comment">--reload</span>

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

[<span class="hljs-meta">Unit</span>]
Description=overture
After=network.target
[<span class="hljs-meta">Service</span>]
ExecStart=/usr/local/overture/overture-linux-amd64 -c /usr/local/overture/config.json
Restart=<span class="hljs-keyword">on</span>-abort
[<span class="hljs-meta">Install</span>]
WantedBy=multi-user.target

启动overture

systemctl enable overture
systemctl <span class="hljs-keyword">start</span> overture

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

 

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

 

发表评论