Your question
I just set up automatic DNS management for a domain with an alias. However the automatic DNS seems to only update the main domain and not the aliases.
Is there any possibility to also update the alias domains or do I need to add them as separate domains and do a catch-all forwarding from the alias domain (and how do I setup a catch-all forwarding?).
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
The key point is in the “Identity and aliases” section of the Domain docs: domain aliases listed in the aliases field on the Domain object are treated as equivalent to the primary domain for accepting mail, but they do not get their own separate DNS management – they share the primary domain’s DNS settings. Since the automatic DNS management is tied to the primary Domain object, it only manages DNS records for the primary domain name. Aliases are not separate DNS zones.
Here’s the situation and what you can do:
Why alias domains don’t get automatic DNS management: Domain aliases in Stalwart are just additional names recognized as local on the same Domain object. They don’t have independent DNS zones or DNS management settings – those all belong to the primary domain. The automatic DNS management publishes records (MX, SPF, DKIM, DMARC, etc.) for the primary domain’s zone only.
The recommended approach for full DNS management of an alias domain is exactly what you suspected: add the alias as a separate Domain object with its own automatic DNS management configured. You can then set a catch-all address on that separate domain to route all mail addressed to it to your primary domain’s mailboxes.
Setting up a catch-all: On the separate Domain object for your alias domain, set the catchAllAddress field to the destination address you want all unmatched recipients to go to. For example:
{
"name": "alias-domain.com",
"catchAllAddress": "[email protected]"
}
This way, any address at alias-domain.com that isn’t explicitly defined will be delivered to [email protected] (or whatever address you specify). You can also add explicit account aliases for [email protected] to map to individual mailboxes.
Relevant docs:
This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.
Thanks. Maybe catch-all is not the correct term.
I’d like to setup the “alias” domain so, that mails to localpart@alias-domain will be forwarded to localpart@target-domain for all possible localpart addresses (even if they don’t exist on the target domain).