2543 次浏览
DNS 服务器安全防护:如何避免成为 DDoS 攻击跳板
- 2543 次浏览
- 139 人觉得有用
# 查看53端口实时流量
watch "netstat -nup | grep :53"
# 查看最近100条DNS日志
tail -100 /var/log/named.log
vi /etc/named.confrecursion no;systemctl restart named# 限制每秒最多100个请求
iptables -A INPUT -p udp --dport 53 -m limit --limit 100/s -j ACCEPT
named.conf中添加:
edns-udp-size 512;
dnssec-utils增强验证dnstop:实时监控 DNS 流量rkhunter:检测异常请求模式# 当53端口流量超过100Mbps时报警
iftop -P -n -N -P -s 10 | grep 53 | awk '{print $1}' | while read line; do if (( $(echo "$line > 100" | bc) )); then sendmail admin@example.com "DNS流量异常"; fi; done
# 检查是否开启递归查询
grep recursion /etc/named.conf
# 关闭动态更新功能
vi /etc/named.conf
update-policy { deny all; };
iftop发现大量 UDP 53 端口流量dnstop定位到异常查询模式iptables -A INPUT -s 192.168.1.100 -j DROP