[root@dns ~]# vim /etc/named.conf [root@dns ~]# grep local_subnet /etc/named.conf acl "local_subnet"{ 163.17.0.0/16; 120.110.0.0/16; }; allow-query-cache { local_subnet; }; allow-recursion { local_subnet; };
[root@dns ~]# /etc/init.d/named restart
[root@dns ~]# yum install fail2ban
[root@dns ~]# vim /etc/fail2ban/jail.conf [root@dns ~]# /etc/init.d/fail2ban start [root@dns ~]# chkconfig fail2ban on
[root@dns ~]# fail2ban-client add nsd Added jail nsd [root@dns ~]# fail2ban-client status nsd Status for the jail: nsd |- Filter | |- Currently failed: 0 | |- Total failed: 0 | `- File list: `- Actions |- Currently banned: 0 |- Total banned: 0 `- Banned IP list: [root@dns ~]# fail2ban-client add named-refused Added jail named-refused [root@dns ~]# fail2ban-client status named-refused Status for the jail: named-refused |- Filter | |- Currently failed: 0 | |- Total failed: 0 | `- File list: `- Actions |- Currently banned: 0 |- Total banned: 0 `- Banned IP list: [root@dns ~]# fail2ban-client add named-refused-udp Added jail named-refused-udp [root@dns ~]# fail2ban-client status named-refused-udp Status for the jail: named-refused-udp |- Filter | |- Currently failed: 0 | |- Total failed: 0 | `- File list: `- Actions |- Currently banned: 0 |- Total banned: 0 `- Banned IP list: