Skip to Content

How to Disable DNS Recursion in Red Hat BIND Prevent Devastating Attacks?

Why Is Disabling DNS Recursion in Red Hat BIND a Powerful Security Move?

Leaving DNS recursion enabled on your BIND server can expose your system to severe security threats, such as DNS amplification attacks. These attacks exploit vulnerable DNS servers to overwhelm targets with massive traffic, potentially taking your site offline and damaging your reputation. In one real-world scenario, a server was knocked offline after being abused in a DDoS attack, all because DNS recursion was left enabled by default.

How to Disable DNS Recursion in Red Hat BIND Prevent Devastating Attacks?

What Is DNS Recursion and Why Is It Risky?

  • DNS recursion allows your server to resolve queries on behalf of others, even for domains it isn’t authoritative for.
  • Attackers can exploit this by sending spoofed requests, causing your server to flood a victim with data (DNS amplification attack).
  • If your server is publicly accessible with recursion enabled, it becomes a prime target for abuse, leading to downtime and degraded performance.

How to Check and Disable DNS Recursion in BIND

Disabling DNS recursion is a straightforward but essential step to secure your server. Here’s how you can do it:

Disable DNS Recursion from the Console

Step 1: Access the BIND Configuration File

Open a terminal and navigate to the BIND configuration directory:

cd /etc
vi named.conf

Step 2: Edit the Configuration

  1. Find the line recursion yes; near the top of the file.
  2. Change it to recursion no; to disable recursion.
  3. In vi, press I to enter insert mode, make the change, then press Esc and type :wq (or ZZ) to save and exit.

Step 3: Restart the BIND Service

Apply your changes by restarting BIND:

service named restart

Alternatively, use:

sudo systemctl restart bind9

Confirm that recursion is disabled using an online DNS testing tool.

Disable DNS Recursion Using Webmin

Step 1: Log into Webmin

Navigate to: Servers > DNS BIND Server > Edit Config File.

Step 2: Edit the Recursion Setting

Change recursion yes; to recursion no; and save the file.

Step 3: Restart BIND

In the top right corner, click ‘Stop BIND’ and then ‘Start BIND’ to apply the changes.

Advanced: Restrict Recursion to Trusted Networks

If you need recursion for internal clients but want to block it for the public:

Step 1: Define an Access Control List (ACL) for trusted IPs:

acl "trusted" { 127.0.0.1; 192.168.1.0/24; };

Step 2: In the options section, allow recursion only for trusted IPs:

allow-recursion { trusted; };
recursion no;

This ensures only specified internal networks can use recursion, blocking all others.

Why Disabling DNS Recursion Is a Positive Security Move

  • Prevents your server from being abused in DDoS attacks-protecting your uptime and reputation.
  • Reduces attack surface for hackers, making your infrastructure more resilient.
  • Boosts your website’s SEO by minimizing downtime and ensuring a secure, trustworthy environment for users and search engines.

By taking these steps, you dramatically strengthen your server’s defenses and ensure a safer, more reliable online presence.