Issue Description
I operate my DNS server with two views (External for all required external addresses etc. and Internal for all internal addresses). The stalwart DNS provider is set to update the zones in the External view while the DNS resolver is set to use the system default which is Internal zones. When stalwart tries to rotate dkim entries it will update the zones in the External view which works but then checks for the update via the system resolver which returns the Internal zone’s data. The latter does not contain DKIM records. Thus the update is considered failed and the Selector for signing outgoing e-mails is not updated.
Expected Behavior
Use the DNS provider to check if the update has worked
Actual Behavior
checks the DNS resolver which is not the same view as the Provider
Reproduction Steps
Configure a DNS server with two views
Set up an update policy for the external view that allows updates with a specific DNS-Key
Set up the DNS provider in stalwart to point to the DNS server with the DNS key
Set up the DNS resolver in stalwart to point to the DNS server without the key (or use system default which should do the same)
Run DKIM rotate task
Relevant Log Output
DKIM record v1-ed25519-20260924._domainkey.ABC.de. did not propagate, will retry.; DKIM record v1-rsa-20260924._domainkey.ABC.de. did not propagate, will retry.; DKIM record v2-rsa-20261016._domainkey.ABC.de. did not propagate, will retry.
Stalwart Version
v0.16.x
Installation Method
Binary (Linux)
Database Backend
MySQL
Blob Storage
S3-compatible
Search Engine
MySQL
Directory Backend
Internal
I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.
on
I have searched this support forum (open and closed topics) and confirm this is not a duplicate.
on
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
on
Now I have enough confirmation: the propagation check always uses the server’s configured DNS resolver (self.core.smtp.resolvers.dns), not the DnsServer/DnsProvider used for updates, and there’s no setting to make it use the provider’s own lookup or a specific resolver per DnsServer object.
Propagation checks after a DKIM rotation are done via Stalwart’s global DNS resolver (the DnsResolver object), not through the DNS provider (DnsServer) that performed the update. The code path after publishing the record calls wait_for_txt_propagation, which looks up the TXT record using core.smtp.resolvers.dns (the configured resolver), independently of which DnsServer wrote it. So with a split-view DNS setup, if the resolver is set to System (and that resolves to your Internal view), it will never see the TXT record that was written to the External view, and the rotation will be retried indefinitely with “did not propagate” errors.
There’s no setting that makes propagation checks use the DNS provider’s own server instead of the resolver. The practical workaround is to point the DnsResolver object itself at your External-view DNS server (or another resolver, public or custom, that can see the External view) rather than leaving it on System. You can do this with the Custom resolver variant, specifying the External view’s IP address directly:
{
"@type": "Custom",
"servers": {
"0": {"address": "<external-view-dns-ip>", "port": 53, "protocol": "udp"}
}
}
Be aware this resolver is also used for MX, SPF/DKIM/DMARC verification, reputation lookups, etc. throughout the MTA, so switching it away from System affects more than just DKIM propagation checks, not just the rotation task.
Reference: DNS Resolver | Stalwart and DNS Providers | Stalwart
This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.
Stalwart checks propagation with its own resolver on purpose. That’s the same view it uses to verify DKIM, DMARC and ARC on incoming mail, including mail between your own domains and from internal hosts, so with no _domainkey records in the Internal view those checks would fail as well. Asking the provider would mark the key as published while Stalwart itself still couldn’t see it. The propagation step is described at DNS records | Stalwart.
I’d fix this in BIND. Have the Internal view serve or forward the public zone (at least the _domainkey names), or match Stalwart’s source address to the External view, or point Stalwart’s resolver at a server that answers from External (DNS Resolver | Stalwart). The rotation task keeps retrying, so it picks the records up as soon as they’re visible.
Hi,
I do understand that. However that does not help me here. There is a good reason behind two views that should return two separate zone information.
Forwarding does not work either because
a) I cannot configure bind to forward only if the local zone did not return a RR and
b) there is no way to distinguish the forwarding system from the forwarder since they both reside on the same IP addresses.
So it seems that my only chance is to set up inotify to watch the journal file of the external zone, extract the changes from the journal file and apply them to the internal zone…
Since I have no other solution for that problem I now resorted to a litte program.
I use the inotify service to watch the journal files for the zones in question. When a “close after write” event happens to the files I retrieve the content with “named-journalprint” and strip everything before the last “Transaction” line. I then only take the modifications to any “TXT” resource record and feed that into an nsupdate to the corresponding internal zone.
Works so far…