Normally the engine resolves a name when recipients appear for the domain — and that takes time, the more so the more loaded the resolver is.
The mechanism reverses the order: domains from the file are kept resolved always, whether or not there are messages for them in the queue. They are refreshed on their own schedule, not by the receiver’s record time to live: that time to live is ignored.
The manual names two problems the mechanism solves: resolver load when many domains are loaded at once, and domains with a short record time to live.
There are three settings, all in the <dns> block: the list file (precached-domains-file), the refresh interval (precached-refresh-interval) and the cap on the number of domains (precached-max-domains).
Large receivers do change routes, and the short record time to live they use is no accident: it is their way to switch traffic quickly. The precache disables that way.
The second half is quieter: only the first entries up to the cap are taken from the file. A longer list is cut off silently, and domains you considered cached are resolved the ordinary way.
The mechanism would fit our case exactly — the node sends to a few large receivers, and their names are resolved again and again. But the price is the same: we would see a receiver’s route change with a delay of one refresh interval, and would learn nothing about it.
# three lines: the list, the cap and the refresh schedule <dns> precached-domains-file /etc/pmta/precached-domains.txt precached-max-domains 500 precached-refresh-interval 5m </dns>
what people get wrong and how it ends3 mistakes▶
§ 11.12
§ 11.12
§ 11.12
3 relations
Flush the name cacheClears the name cache for a domain — the only way not to wait for the next refresh. inferenceThe node needs a resolver that does all the work itselfThe mechanism takes load off the resolver exactly for the domains that matter most — but does not cancel the requirements for the resolver itself. inference
grep -n -A4 '^<dns>' /etc/pmta/config pmta show precache wc -l /etc/pmta/precached-domains.txt
3 articles
◇A queue is a receiving server together with a sending addressThe engine groups messages by the “recipient domain plus sending address” pair: one domain from two addresses is two independent queues with their own counters, connections and mode.◇Recipients deferred after a temporary refusalA recipient to whom the receiver responded with 4xx moves into a separate waiting area with a per-receiver interval; two commands can release it early.◇A retry ladder of your ownretry-after and backoff-retry-after accept a list of intervals — up to 30 steps, and the last one applies until the bounce.