Knowledge base

clear dnscache

Flush the name cache
Force the records to be queried again

Removes all records of the given domain from the internal DNS cache; with the * star, the whole cache. In a Unix shell the star is escaped with a backslash.

It helps when the receiver’s MX records or addresses have changed while the node still goes by the old cached ones: the next delivery requests them anew.

It changes node state, but harmlessly: messages and settings are not touched, only the number of queries to the name server grows.

The main trap is expecting the flush to help the receiver. The command clears the cache of its own node. If the receiver does not see a new record for your domain — a signing key, SPF — that is its cache and the record’s time to live, and no command on the node will speed it up.
What the Hub does. It calls it — the “Clear name cache” operation in node control goes through POST /command with the node key and the domain from the form.
Recommended values

When to call it:

Question This command or not
the node goes to the receiver’s old MX yes — the receiver’s domain
the receiver does not see a new record for our domain no — that is its cache
what the name server answers now no — resolve
The action, the star and escaping it come from the manual (§ 6.3.1). The split of questions is ours.
Example configuration
# flush one domain's records and the whole cache
pmta clear dnscache example.compmta clear dnscache \*
The manual also writes it in short — pmta clear dns.
yellow — — directive names, blue — blocks. They are highlighted the same way in the text of the card.
Compatibility
PowerMTA 6.0
described in the manual of this version · platform: any
The vendor does not state the first version for every directive — there is no note here. The name also appears in the 5.0 edition of the manual.
How to check on the node
Make sure the name resolves anew after the flush:
pmta resolve example.com
The command shows the name server’s fresh answer — the records the next delivery will use.
In the Hub
Cost of a mistake
reversible: harms only while it is set
Scenarios
Key rotation · Untangle a stuck queue