Add another domain

Multiple Domain Names

Your box can host email and serve static websites for more than one domain name. To set up additional domain names, just follow three steps:

  1. Buy an additional domain name if you don’t yet own it. See the Your Domain Name section of the setup guide for tips.
  2. Configure its nameservers to be the same nameservers on your first domain name. Follow the Domain Name Configuration — Nameservers section of the setup guide for instructions.
  3. Add an email account (user) or alias on your box for the new domain name using the control panel. If you only plan to serve a website, still add an email address or alias — that’s how the box knows to handle that domain name.

Why do I need step 2?
“Configure its nameservers to be the same nameservers on your first domain name.”

I was thinking I can do this steps

  1. Create a mail user in box.domain.com/admin so that new values will be generated in the external DNS section of MIAB
  2. Use the values in the External DNS and create DNS entry for the 2nd domain in the current registrar

ex.
MX
Host: mail
value: box.domain2.com
priority: 10

next is use the A/AAAA, spf, txt in the external DNS for domain2.com

Will this work?

No

If it were the correct MX record it will only deliver email in the format of user@mail.domain2.com, however the MX of the box is box.domain.com, not box.domain2.com. One has to keep in mind that the MX record is always the host name of the mail server.

Yes, this is absolutely the way that it can and should be done.

To tell the internet where the mail for your domain is to be delivered …

The real question that you are asking here is “Is it necessary to set the name servers before I add an email account to the box?”. And the answer is no, not really. It just makes sense from a force of habit to always add the MX record before adding a mailbox.

1 Like

@alento

I think its working now yay for MIAB! I received an email from the newly created mail user.

my MX entry is:
Host: @
value: box.domain.com
priority: 10

I don’t get why I should add the MX record before adding a mailbox. My thinking is the opposite. Create a mailbox user and then add the mx and other dns entry

It is not the case in MiaB specifically, but some email systems will check to see that the MX record is enabled before a mailbox can be added for a domain. As I mentioned this order of things is a force of habit for people who have been doing email for 20 years.

Again though I see a problem with your MX record so let’s draw out an example.

I am going to assume that you have two domains that you are wanting MiaB to handle email for. domainone.com and domaintwo.net.

You create a MiaB install on a vps somewhere giving it the hostname of box.domainone.com. This means that the MX record for that mail server is going to be box.domainone.com ALWAYS! (Unless you do whitelisting which is not a part of this discussion)

When you add the DNS entries for the domain domainone.com you will add a MX record as follows:
@ MX 10 box.domainone.com

When you add the DNS entries for the domain domaintwo.net you will add a MX record as follows:
@ MX 10 box.domainone.com

PLEASE NOTE, the MX record is box.domainone.com NOT box.domaintwo.net!!!

You said that you received an email from the newly created email user … yes, you will receive mail FROM that user just fine, however mail TO that user from a different mail server will not arrive. This assumes that your MiaB hostname is box.domain.com which is what you reported in your opening post.

Thanks for pointing that out. I’ve edited my earlier post.

I really appreciate all the information and habit when working with mailboxes!
I added the DNS entry and will be monitoring in the next few days for deliverability. So far the testing went well.

@vlad0325, @alento
Hey guys, Should I change A record too?

What you SHOULD do is start a new topic rather than replying to one from over 2 years ago. And consider explaining the question. i.e. Which A record? for what? Nobody has a clue what you are talking about.

1 Like