CentOS 7 - NGINX - DNS 负载平衡

CentOS 7 - NGINX - DNS Load Balance

正在使用 NGINX 在 CentOS 7 上构建 DNS 负载平衡服务。 如果这个在 Ubuntu 上工作但开始得到参差不齐的结果并想转移到 centos。 我 运行 遇到的问题是端口 53 被占用了,我似乎无法弄清楚是什么。 这是有道理的,因为 Ubuntu 有同样的问题但很容易修复。只需关闭 运行 持有端口 53 的服务即可。 我一直在挖掘和谷歌搜索我的屁股,但似乎找不到确凿的证据。

什么服务在 CentOS 上默认占用端口 53?

非常感谢任何帮助。谢谢。

● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/nginx.service.d
           └─nginx.conf
   Active: failed (Result: exit-code) since Wed 2019-12-18 16:11:02 EST; 13min ago
  Process: 1863 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
  Process: 1861 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)

Dec 18 16:11:02 dnsload.dutil.com systemd[1]: Starting The nginx HTTP and reverse proxy server...
Dec 18 16:11:02 dnsload.dutil.com nginx[1863]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Dec 18 16:11:02 dnsload.dutil.com nginx[1863]: nginx: [emerg] bind() to 0.0.0.0:53 failed (13: Permission denied)
Dec 18 16:11:02 dnsload.dutil.com nginx[1863]: nginx: configuration file /etc/nginx/nginx.conf test failed
Dec 18 16:11:02 dnsload.dutil.com systemd[1]: nginx.service: Control process exited, code=exited status=1
Dec 18 16:11:02 dnsload.dutil.com systemd[1]: nginx.service: Failed with result 'exit-code'.
Dec 18 16:11:02 dnsload.dutil.com systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
stream {
    upstream dns_servers {
        least_conn;
        zone dns_mem 64k;
        server 192.168.100.240:53 fail_timeout=60s;
        server 192.168.100.241:53 fail_timeout=60s;
        server 192.168.100.239:53 fail_timeout=60s;
    }

    server {
        listen 53  udp;
        listen 53; #tcp
        proxy_pass      dns_servers;
        error_log       /var/log/nginx/dns.log debug;
        proxy_responses 1;
        proxy_timeout   1s;
    }
}

PowerDNS DNSDIST https://dnsdist.org/

发现这太棒了! dns负载均衡解决方案!