停止 DNS 服务器上无意义的大量查询

停止 DNS 服务器上无意义的大量查询

几个星期以来,我遇到了一个令人困扰的问题……我的三个 DNS 服务器之一(作为 Plesk DNS 主服务器的从服务器运行 bind9)被无意义的 DNS 请求充斥。这些请求的原始 IP 来自世界各地,因此我无法通过以下方式删除 IP 范围或整个国家/地区:iptables

以下是几行日志,以便您了解这些“攻击”的计划:

10-May-2015 11:15:54.714 client 120.87.202.161#47441: query: sjgzincrmxobabst.www.luzhiye.com IN A + (my-ip)
10-May-2015 11:15:56.252 client 111.187.196.51#41387: query: mrcf.www.330dp.com IN A + (my-ip)
10-May-2015 11:15:56.806 client 89.90.44.173#56673: query: qzwp.www.330dp.com IN A + (my-ip)
10-May-2015 11:15:57.891 client 116.93.242.237#55721: query: srapafupglkxaver.www.330dp.com IN A + (my-ip)
10-May-2015 11:15:59.611 client 123.153.92.59#20847: query: yj.www.330dp.com IN A + (my-ip)

这些请求并不是真正的攻击,因为主机服务器非常放松。我尝试使用 iptables 阻止请求,但几分钟/几小时后,请求的域就会发生变化,所以我没有机会这样做。

Chain INPUT (policy ACCEPT)
target     prot opt source               destination
DROP       all  --  anywhere             anywhere             STRING match  "888fy.com" ALGO name bm TO 65535
DROP       all  --  anywhere             anywhere             STRING match  "taohua.me" ALGO name bm TO 65535
DROP       all  --  anywhere             anywhere             STRING match  "yymo.us" ALGO name bm TO 65535
DROP       all  --  anywhere             anywhere             STRING match  "taohuazu.cc" ALGO name bm TO 65535
DROP       all  --  anywhere             anywhere             STRING match  "taohua.me" ALGO name bm TO 65535
DROP       all  --  anywhere             anywhere             STRING match  "227x.com" ALGO name bm TO 65535

有人经历过这种“攻击”吗?如何阻止它?我尝试关闭整个服务器 48 小时。重启后不再有攻击,但几个小时后它们又开始了。

配置(named.conf.local / named.conf.options):

dnssec-validation auto;
allow-new-zones yes;
notify master-only;

auth-nxdomain no;    # conform to RFC1035
listen-on-v6 { any; };

statistics-file "/var/cache/bind/named.stats";
zone-statistics yes;

controls {
        inet * port 953 allow { plesk-ip; 127.0.0.1; } keys {"rndc-key"; };
};

logging {
        channel b_query {
                file "/var/log/bind9/query.log" versions 2 size 1m;
                print-time yes;
                severity info;
        };
        category queries { b_query; };
};

我运行了一些在线测试,再次验证了我的 DNS 服务器不是开放解析器。成功:未找到开放的解析器。

非常感谢您的帮助!

相关内容