Insights

Test the Resolvers in WHM Resolver Configuration Before Mail and AutoSSL Slow Down

November 9, 2026
0:00
A cPanel server can show normal load, plenty of free memory, and every service green in WHM while outgoing mail sits in the queue, AutoSSL runs take far longer than they should, and the license check sometimes reports it could not reach its server. People often blame the network or the mail provider. Very often the real cause is one of the resolvers listed in WHM's Resolver Configuration. It has gone slow or stopped answering, and every process on the box waits for it before moving on. The server doesn't look broken because nothing is broken locally. Processes aren't crashing. They're waiting. To see why a single bad entry can cost so much time, look at what happens inside a process when it resolves a name.
The Resolver Configuration screen in WHM is a front end for /etc/resolv.conf. That file lists up to three nameserver lines, plus optional options such as timeout and attempts. Nothing on a typical cPanel box sits between applications and those upstream servers unless you installed a local caching resolver yourself. When Exim, a PHP script, or a cPanel tool needs an address, it usually calls into the C library, for example getaddrinfo() in glibc. glibc reads /etc/resolv.conf, builds a DNS query, and sends it over UDP port 53 to the first nameserver in the list. Then it waits for a reply on that socket. Three things can happen next:
  1. The resolver answers quickly with an address or a clean "this name does not exist" (NXDOMAIN). The lookup finishes in milliseconds.
  2. The resolver answers with an error such as SERVFAIL or REFUSED. glibc typically treats that as a reason to try the next nameserver. That costs a little time but no long wait.
  3. Nothing comes back. The packet was dropped, the resolver is overloaded, or the IP no longer runs a DNS service. glibc can't tell "slow" from "dead", so it waits the full timeout and then moves to the next server.
The third case causes the trouble. By default, glibc's timeout is 5 seconds per try and it makes 2 attempts across the list. Those defaults are documented in man resolv.conf, but check them on your distro. Also, glibc often sends the A and AAAA queries for a name together. If either reply goes missing, the whole call waits.
glibc has no memory of failures between calls. Each new process, and each new lookup in a long-running process, starts at the first nameserver again. If the first entry is dead and the second is healthy, every single lookup pays roughly one full timeout before it gets its answer. The server never "learns" to skip the bad one. As an illustrative example with default settings, a dead first resolver means about 5 extra seconds per name lookup. If all three listed resolvers are unreachable, one lookup can take tens of seconds before it fails. The exact backoff differs between glibc versions, so treat those numbers as orders of magnitude, not measurements. This is why the failure feels strange from the outside. DNS still works, technically. Every answer just arrives seconds late. Monitoring that only checks "did the name resolve" stays happy. A partial failure also looks the same: a resolver that drops some packets under load gives you intermittent multi-second stalls that are hard to reproduce on demand. The same mechanism slows down web workers that make outbound requests. That angle is covered in Why Using Public Resolvers in resolv.conf Stalls Apache Workers. On a WHM box, the services hit hardest are the ones that make many lookups per job.
Exim is the clearest case. Delivering one message to a remote domain usually means looking up the MX records, then the A and AAAA records for each mail host. Depending on the configuration, it may also check DNS blocklists, SPF, DKIM keys, and reverse DNS for connecting clients. Each of those is a separate query. A per-lookup penalty of several seconds, multiplied across a handful of queries per message, turns quick deliveries into slow ones. Exim also has its own DNS retry settings (dns_retrans and dns_retry). It goes through the system resolver library, so a dead upstream still costs it time. When lookups time out instead of failing cleanly, Exim may treat them as temporary errors and defer the message. That shows up as a growing queue with retry entries, not hard bounces. Before clearing anything out of a queue like that, read the headers and logs as described in Exim Queue Full of Frozen Messages? Read the Headers Before Deleting Them. Resolver timeouts often show up there as DNS-related temporary errors. AutoSSL works through many domains in one run. For each domain it resolves names, both for its own checks and to talk to the certificate provider. A server hosting hundreds of domains makes a lot of lookups per run, so a slow first resolver can stretch a run noticeably. It can also trigger timeouts that look like domain validation problems even when the domain's DNS is correct. License verification and update checks are smaller jobs, but they have tight timeouts of their own. If the name of the remote endpoint takes too long to resolve, the tool reports that it can't reach its server, and people suspect a firewall or an outage on the vendor's side instead. The common thread for support: when several unrelated services on one box get slow at the same time and none of them shows high CPU, test the resolvers before anything else.
One dig query against the default resolver isn't enough. dig picks its own server and its own timeout, and a single good answer can come from the healthy second entry. The useful test is to query every listed resolver by itself, with a short timeout and one try, so a dead entry shows up right away. This loop reads the current list from /etc/resolv.conf and tests each entry. It's read-only and safe to run on a production server.
BASH
# Query each configured resolver on its own: short timeout, single try
for ns in (awk '/^nameserver/ {print2}' /etc/resolv.conf); do
  echo "== $ns"
  dig @"$ns" example.com A +time=2 +tries=1 | grep -E 'status:|Query time|timed out'
  dig @"$ns" example.com AAAA +time=2 +tries=1 | grep -E 'status:|Query time|timed out'
done
Use a domain the resolver has to look up recursively, not one hosted on the same server. Run it a few times, because a resolver that drops some packets may pass once and fail the next time. A healthy entry shows status: NOERROR and a low query time. A dead or unreachable one prints a timeout line.
TEXT
# Illustrative output format
== 192.0.2.10
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4120
;; Query time: 8 msec
== 192.0.2.20
;; connection timed out; no servers could be reached
dig tells you about each server but not what applications actually experience, because it ignores the timeout and attempts options and the server order. To see the real cost through glibc, time a lookup via getent. It uses the same resolver path as most services on the box.
BASH
# Time a lookup through glibc, the same path Exim and cPanel tools use
time getent ahosts example.com
A lookup that takes about 5 seconds, or a multiple of that, while your dig loop shows one entry timing out, confirms the mechanism. The first healthy answer arrives only after glibc gives up on the dead server.
If one entry times out and the others answer quickly, remove or replace that entry in WHM's Resolver Configuration. Moving it to the end of the list helps, but every lookup that reaches it still pays the timeout, so removing it is usually the cleaner fix. After saving, check /etc/resolv.conf to confirm the change landed, and run the getent timing again. If an entry is 127.0.0.1 or the server's own IP, make sure something on the box actually answers recursive queries. On many cPanel servers the local DNS service is set up as an authoritative nameserver for hosted zones, not as a recursive resolver for the internet. In that setup it can answer for local domains and fail or refuse everything else. That depends on how the server was built, so test it with the dig loop and don't assume either way. If an entry answers but slowly, for example hundreds of milliseconds every time, check whether it's far away on the network or rate-limiting you. A provider resolver in the same data center is usually faster and more predictable than a distant public one. Make that call from your measurements, not from the resolver's reputation. If every entry times out, the problem probably isn't the resolvers. Look at outbound UDP and TCP on port 53 in the server firewall, upstream filtering, and general network reachability. It's tempting to lower options timeout so failures cost less. That can be a reasonable trade-off, but it hides the dead resolver. A too-aggressive timeout can also turn slow but valid answers into failures. Fix the list first, then tune the timeout if you still need to. The habit worth building is small. Run the per-resolver dig loop whenever a server is provisioned or migrated, and again whenever mail, AutoSSL, and license checks get slow together. Better still, run it on a schedule and alert on any entry that times out. It takes seconds, it's read-only, and it catches a resolver problem before it turns into a queue of deferred mail and a stack of tickets about a server that looks healthy.

Join My Newsletter & Get Updates!

Get notified whenever a new technical guide, server infrastructure breakdown, or personal reflection goes live, plus a curated weekly digest.