Change the primary domain but keep the old domain settings


Coinciding with the the upgrade to version 0.43 of MIAB and the change to Ubuntu 18.04, I would like to change the primary domain of the server.

At this moment I have the new machine configured with the new domain and working correctly. I’m going to import the backup of the previous server to shut it down, but I need to know, how could I make the users that I have in the old machine can keep their email settings (the domain name), to avoid having to change all one to one.

Is there a solution for the old domain to work transparently even if the new settings are made with the new domain?

Please elaborate — are you simply wanting to change the hostname of the MiaB itself, or are you wanting to change all of the user’s email addresses to the new domain?

Hello, sorry, maybe my question is not well written.

The server has multiple user domains, other than the primary domain.

Primary Domain:

New main domain:

I want to know if the users who use the domain in their email configuration could continue doing so if I do that both the old and the new are pointing to the same ip.

Yes. It wasn’t clear if you had wanted to rename all of the old user accounts to the new domain, or not in the OP. :slight_smile:

Personally, I would suggest to assign your new MiaB install with the old hostname by running sudo mailinabox again … then restore your files. This will restore everything as normal - THEN rerun sudo mailinabox changing to the new hostname. I suspect that this will go much smoother in the long run. I am not sure that I have helped anyone do this before but just my experience says that this will be the path of least resistance.

Not clear here though … you want the old domains MX record to point to the new domain …will you be using MiaB for DNS for the old domain going forward? You would not point any IP’s. The old users will log in to the new domain to read their mail.

Thank you very much, but I think it is not exactly what I am asking.
My question is, do I have to change the settings in the mail clients (outlook, etc) of my users? Or can I leave the old domain in its configuration and make it point to the new ip of the new server?

Users do not use webmail, they have their accounts set up in their email clients.

For example, customers now have the account set up through IMAP and with the domain
If I create a new MIAB server at, I import the backup from, and change the A record of the domain DNS to the IP of would it work?

Let me ask this … why do you want to change the domain to from … why not leave it as is? Maybe there is something that you are not considering and there is a simpler solution … I’ll come back and answer the questions in your last reply shortly. :slight_smile:

In theory, I think so. But I imagine some issues would need to be ironed out. I would suggest doing a trial first …

1 Like

I need to change the name to the domain. To prevent a blacklist or reputation problem from causing other services to be affected.

I want to distribute the servers in three different domains.

Corporate web server (
Data server. (
Email server (
Database Server (

and the email server was initially set up in the main company domain’s name I presume?

Yes it is.
I need to change that.

I will do some tests tonight when the mail server is not being used and if I see that it works I’ll write the conclusions.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.