fail2ban-unbound
Not logged in

Sample fail2ban configuration to protect an unbound DNS resolver.

Installation

# Copy the filter
cp unbound.conf /etc/fail2ban/filter.d/unbound.conf

# Copy (or merge) the jail config
cp jail.local /etc/fail2ban/jail.local

# Restart fail2ban
systemctl restart fail2ban

How it works

The filter (unbound.conf) matches unbound query-log lines via fail2ban's <HOST> tag. The jail (jail.local) bans IPs that exceed the retry threshold using iptables on UDP port 53.

Notes

License

BSD-2-Clause. See LICENSE.