How can I setup a local caching DNS resolver to speed up DNS queries used by Amavis?

Overview

This article provides instructions for verifying local DNS caching status and configuring BIND as the local resolver on a Plesk server. Enabling local DNS caching improves query resolution performance and ensures compatibility with services that require recursive DNS functionality.

Prerequisites

  • Root or sudo access to the server
  • Plesk Obsidian or Plesk Onyx installed
  • Network connectivity for package installation and DNS queries

Verify Current DNS Caching Status

Execute the following command to determine whether local DNS caching is currently enabled:

host -tTXT 2.0.0.127.multi.uribl.com

If local DNS caching is disabled, the output will resemble the following:

2.0.0.127.multi.uribl.com descriptive text "127.0.0.1 -> Query Refused. See http://uribl.com/refused.shtml for more information [Your DNS IP: 203.0.113.1]"

Install and Configure BIND as Local Resolver

  1. Install the BIND component: If BIND is not already installed, run the following command via Plesk Installer:
    plesk installer add --components bind
  2. Validate configuration syntax: Ensure there are no errors in the BIND configuration files by running:
    named-checkconf
    If the command returns no output, the configuration is syntactically correct. Address any reported errors before proceeding.
  3. Restart the DNS service: Apply the changes by restarting the appropriate service for your operating system:
    • AlmaLinux/CloudLinux/RHEL:
      systemctl restart named-chroot
    • Debian/Ubuntu:
      systemctl restart bind9
  4. Configure the local resolver: Edit the /etc/resolv.conf file and add 127.0.0.1 as the primary nameserver:
    nameserver 127.0.0.1

Verify Configuration

Allow a few minutes for the DNS cache to initialize, then execute the verification command again:

host -tTXT 2.0.0.127.multi.uribl.com

If local DNS caching is successfully enabled, the output will display:

2.0.0.127.multi.uribl.com descriptive text "permanent testpoint"

Troubleshooting & Common Issues

  • /etc/resolv.conf overwritten on reboot (RHEL-based systems): If the server uses NetworkManager and DNS entries are defined in /etc/sysconfig/network-scripts/ifcfg-*, the /etc/resolv.conf file will be regenerated upon reboot. To prevent this, either remove the DNS directives from the interface configuration files or use the nmcli utility to configure DNS settings persistently.
  • Configuration syntax errors: If named-checkconf returns errors, review the BIND configuration files and correct any malformed directives before restarting the service.
  • Delayed cache propagation: DNS caching may require several minutes to populate. If the verification command still returns a refusal message, wait briefly and retry.
  • dns, optimize, performance, cache
  • 5 Users Found This Useful
Was this answer helpful?

Related Articles

How can I install or upgrade the extension?

We provide free installation and configuration for all our paid licenses. Open a support ticket...

How can I add stronger Postfix restrictions so that the bulk of spam is rejected at the SMTPD level before it gets processed by Amavis?

Overview Warden enables administrators to enforce stricter Postfix SMTPD restrictions. These...

How can I change the interface language of the extension?

Overview This article provides instructions on how to change the interface language within the...

How can I configure greylisting with Warden Anti-spam and Virus protection?

Overview Greylisting is an email filtering mechanism designed to mitigate spam by temporarily...