This Topic was covered once before:
https://discourse.mailinabox.email/t/changing-primary-default-domain/6962
Finally I have cracked it.
So I have successfully managed to change primary/default domain name
and sub-domain name as well:
box.domain.win —> mail.mymail.com 2
here is what I have done:
1] change you rDNS/PTR record at your VPS/ISP provider
box.domain.win —> mail.mymail.com 2
2] change the External nameservers for all [other] domains at your Domain Registrars
ns1.box.domain.win —> ns1.mail.mymail.com
ns2.box.domain.win —> ns2.mail.mymail.com
3] change your Ubuntu Server “host” name and reboot
box.domain.win —> mail.mymail.com 2
4] run the “sudo mailinabox” and change the primary/default domain name on the BOX
5] change the DNSSEC details as requited on all [other] domains at your Domain Registrars according to details from " System Status Checks" page.
6] change all the “Aliases” e-mail addresses for [hostmaster@, postmaster@, admin@ and abuse@] so they point to correct/new primary/default domain