Multiple domains in Mail-in-a-Box / with the domains being hosted elsewhere?

whois is showing my nameservers as:
Name Server: NS1.mydomain.net
Name Server: NS2.mydomain.net

While the Mail-in-a-box /admin system check indicates the nameserver glue records are correct:
ns1/ns2.box.mydomain.net

Is there something wrong here?

Yup, I screwed up. It is fixed now. :smile:

OK, although I fixed my NS glue records, my CNAME configuration still isn’t being served. It’s been over 20 hours. Either I will have to wait even more time for DNS caches to flush or something still isn’t configured correctly. Is there anything else I can verify in my MIAB? Thank you in advance.

To verify- 1) It should be listed in the External DNS tab. 2) You can query from the command line:

dig @box.yourdomain.com cname something.yourdomain.com

The @-parameter is the name or IP address of a DNS server to query, in this case you are checking that the box itself is serving the correct info. And something.yourdomain.com is the domain/subdomain that you set the CNAME record for.

Hey Josh - I just performed this before seeing your response. Great timing. :smile:

My Custom DNS is: “www.thesheehans.net CNAME thesheehans.nfshost.com” which matches the External DNS information tab.

Here’s the output from dig on my box:

root@box:~# dig @ns1.box.thesheehans.net www.thesheehans.net all

; <<>> DiG 9.9.5-3ubuntu0.1-Ubuntu <<>> @ns1.box.thesheehans.net www.thesheehans.net all
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38282
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.thesheehans.net.           IN      A

;; ANSWER SECTION:
www.thesheehans.net.    1800    IN      A       104.236.128.107

;; AUTHORITY SECTION:
thesheehans.net.        1800    IN      NS      ns1.box.thesheehans.net.
thesheehans.net.        1800    IN      NS      ns2.box.thesheehans.net.

;; ADDITIONAL SECTION:
ns1.box.thesheehans.net. 1800   IN      A       104.236.128.107
ns2.box.thesheehans.net. 1800   IN      A       104.236.128.107

;; Query time: 2 msec
;; SERVER: 104.236.128.107#53(104.236.128.107)
;; WHEN: Fri Jan 16 11:35:24 EST 2015
;; MSG SIZE  rcvd: 136

;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 5375
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;all.                           IN      A

;; Query time: 0 msec
;; SERVER: 104.236.128.107#53(104.236.128.107)
;; WHEN: Fri Jan 16 11:35:24 EST 2015
;; MSG SIZE  rcvd: 32

And querying an external NS:

root@box:~# dig @8.8.8.8 www.thesheehans.net all

; <<>> DiG 9.9.5-3ubuntu0.1-Ubuntu <<>> @8.8.8.8 www.thesheehans.net all
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3544
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;www.thesheehans.net.           IN      A

;; ANSWER SECTION:
www.thesheehans.net.    1759    IN      A       104.236.128.107

;; Query time: 23 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Jan 16 11:39:52 EST 2015
;; MSG SIZE  rcvd: 64

;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 62316
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;all.                           IN      A

;; AUTHORITY SECTION:
.                       1282    IN      SOA     a.root-servers.net. nstld.verisign-grs.com. 2015011600 1800 900 604800 86400

;; Query time: 24 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Jan 16 11:39:52 EST 2015
;; MSG SIZE  rcvd: 107

Ah, I bet the default A record for www is preventing the CNAME record from being used.

Mail-in-a-Box would need to be modified to not create default A records if a CNAME record is used.

I’m happy to help debug. Can this be fixed?

I attempted to use the DNS API to delete the A record for www:

curl -d " " --user me@mydomain.com:###### https://box.thesheehans.net/admin/dns/set/www.thesheehans.net/a/__delete__

I receive an OK response, but the External DNS admin page and dig @ns1.box.thesheehans.net www.thesheehans.net all still see the A record for www. :frowning:

1 Like

Yeah, you can’t delete records that you didn’t create.

This will be fixed in the next update. Thanks.

1 Like

Gday, did this issue ever get resolved? I seem to have the same scenario I have A records and CNAME records for the www subdomains, but the subdomains never resolve correctly.

Any advice much appreciated.
Cheers!
Dig:
dave@webserver:~$ dig @ns1.box.gotany.email www.happygoanna.com.au all
; <<>> DiG 9.9.5-3ubuntu0.8-Ubuntu <<>> @ns1.box.gotany.email www.happygoanna.com.au all
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 25382
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.happygoanna.com.au. IN A

;; ANSWER SECTION:
www.happygoanna.com.au. 1800 IN CNAME 188.166.238.213.happygoanna.com.au.

;; AUTHORITY SECTION:
happygoanna.com.au. 1800 IN SOA ns1.box.gotany.email. hostmaster.box.gotany.email. 2016051700 7200 1800 1209600 1800

;; Query time: 2 msec
;; SERVER: 128.199.224.255#53(128.199.224.255)
;; WHEN: Tue May 17 18:01:02 EDT 2016
;; MSG SIZE rcvd: 148

;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 40621
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;all. IN A

;; Query time: 0 msec
;; SERVER: 128.199.224.255#53(128.199.224.255)
;; WHEN: Tue May 17 18:01:02 EDT 2016
;; MSG SIZE rcvd: 32

Am i right in saying there is still no good guide to setting up a new domain that doesnt involve directing the domains nameserver settings to the box?

I have been successfull with adding multiple domains to my box while hosting the websites for them else by changing the DNS, however it doesnt aways work and it would be great to get a concrete solution to e.g.:

  1. I have my main domain [mysite.com] and i set up my mailinabox with that domain.
  2. want to add name@anotherdomain.com to my mailinabox setup, what are the steps?!

So… to get this straight…

When using mail-in-a-box as a mail server for all my sites, I need to set all my sites nameservers to my mail-in-a-box nameserver.

Then in mail in a box, in the custom DNS, I will then create A records with the correct IP for my hosting, for domain.com and www.domain.com.

So any visit to my website will initially redirect to the mail server and then be directed to my website…

Is this not a bit backwards, how much does it slow down websites, how does it affect CDNs etc?

1 Like

You don’t need to, but it is recommended. If you use your Mail-in-a-Box as your nameserver, it’ll take care of your mail-related DNS entries for you. If you don’t use your Mail-in-a-Box as your nameserver, then you are responsible for setting the mail-related DNS entries and keeping them updated — your Mail-in-a-Box will tell you what to set in the External DNS tab of the control panel.

It’s not a redirect. It’s just DNS resolution. This is how DNS resolution works for every website. There is always a DNS server involved.

This doesn’t really have anything to do with CDNs. Many CDNs, like Cloudflare, want to take over your DNS, in which case you would not be using your Mail-in-a-Box as a nameserver anyway.

Thank you Josh,

Regarding the CDN, if Cloudflare is wanting to take over my DNS for my site, will that conflict with Mail-in-a-Box?

Are the two things interporable?

Same as I said above - If you don’t use your Mail-in-a-Box as your nameserver, then you are responsible for setting the mail-related DNS entries and keeping them updated (on Cloudflare) — your Mail-in-a-Box will tell you what to set in the External DNS tab of the control panel.

Okay, so if you use a CDN, take the settings from the external DNS tab and add them into the CDN DNS settings.

I have opened a iit medical coaching in bhubaneswar can I use multiple domain for the same institute and can it be hosted some where else which would work simultaneously.

Is there any reason you are replying to a 2 year old post rather than the one from today on the same topic? But better yet, starting your own post rather than hijacking somone else’s is actually preferable.

So are you actually here to ask something or just to spam with the website you are promoting? Your text is not so clear. And the fact that it is basically the thread topic is rather suspect …

I have asked my doubt

Can you please clarify your question?

Yes, you can host email for several domains.

Yes, you can host your website wherever you like - it is actually better if it is hosted somewhere else, IMHO.