What should be correct MX Mail Server records for a subdomain server

6 posts / 0 new
Last post
#1 Fri, 11/22/2013 - 07:35
yngens

What should be correct MX Mail Server records for a subdomain server

I have two servers involved into this issue: one with a hostname like ns1.domain.tld with IP aaa.aaa.aaa.aa, where sub.domain.tld, a subdomain of domain.tld, has been created as a A-records and pointed to another server with IP address bbb.bbb.bbb.bb.

Now, no issues with the first server's mail, however on the second server with a hostname 'sub.domain.tld', I am getting the following error if you try to activate Mail for virtual server 'sub.domain.tld':

Warning - errors were found in this domain's DNS records :
This domain has email enabled, but none of the MX records point to it.
Either the MX records should be corrected, or the email feature disabled if mail is hosted externally.

And here is the DNS records for the 'sub.domain.tld'

$ttl 38400
@ IN SOA sub.domain.tld. root.sub.domain.tld. (
1384984652
10800
3600
604800
38400 )
@ IN NS sub.domain.tld.
sub.domain.tld. IN A bbb.bbb.bbb.bb
www.sub.domain.tld. IN A bbb.bbb.bbb.bb
sub.domain.tld. IN TXT "v=spf1 a mx a:sub.domain.tld ip4:bbb.bbb.bbb.bb ?all"
sub.domain.tld. IN MX 5 mail.sub.domain.tld.

Where I should look for the solution? Thanks!

Fri, 11/22/2013 - 19:22
yngens

I found one more quite strange behavior. The /etc/postfix/main.cf has initially the following line:

mydestination = sub.domain.tld, sub, localhost

However, whenever I disable Mail for the virtual server and check /etc/postfix/main.cf again, then the line becomes:

mydestination = sub, localhost

I don't get why it keeps changing...

Edit: Deleted reference to running "Validate Virtual Servers" as mydestination gets changed always as soon as I disable Mail for the virtual server.

Fri, 11/22/2013 - 09:19
andreychek

The IP address you see in your DNS zone file for "sub.domain.tld" -- the one listed as "bbb.bbb.bbb.bb" in your example -- is that the correct IP address for your server?

If you run "/sbin/ifconfig", does that IP address show up in one of the network interfaces you see there?

Also, it seems to be missing an 'A' record for "mail.sub.domain.tld" -- you may need to manually add that.

-Eric

Fri, 11/22/2013 - 19:22 (Reply to #3)
yngens

Hi Eric,

Yes, the IP is correct and, of course, ifconfig commands shows it in eth0 interface. And, unfortunately, even after manually creating A-record for mail.sub.domain.tld:

$ttl 38400
@ IN SOA sub.domain.tld. root.sub.domain.tld. (
1384984659
10800
3600
604800
38400 )
@ IN NS sub.domain.tld.
sub.domain.tld. IN A bbb.bbb.bbb.bb
mail.sub.domain.tld. IN A bbb.bbb.bbb.bb
www.sub.domain.tld. IN A bbb.bbb.bbb.bb
sub.domain.tld. IN TXT "v=spf1 a mx a:sub.domain.tld ip4:bbb.bbb.bbb.bb ?all"
sub.domain.tld. IN MX 5 mail.sub.domain.tld.

it still shows:

Warning - errors were found in this domain's DNS records : This domain has email enabled, but none of the MX records point to it. Either the MX records should be corrected, or the email feature disabled if mail is hosted externally.

I am afraid this has something with the fact that disabling Mial for the virtual server changed the value of mydestination in /etc/postfix/main.cf from

mydestination = sub.domain.tld, sub, localhost

to

mydestination = sub, localhost
Fri, 11/22/2013 - 20:08
yngens

Taling -f /var/log/messages gives during disabling Mail for the virtual server:

Nov 22 17:43:27 my named[5068]: zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0
Nov 22 17:43:27 my named[5068]: zone sub.domain.tld/IN: sub.domain.tld/MX 'mail.sub.domain.tld' has no address records (A or AAAA)
Nov 22 17:43:27 my named[5068]: zone sub.domain.tld/IN: loaded serial 1384984670
Nov 22 17:43:27 my named[5068]: zone localhost.localdomain/IN: loaded serial 0
Nov 22 17:43:27 my named[5068]: zone localhost/IN: loaded serial 0
Nov 22 17:43:27 my named[5068]: managed-keys-zone ./IN: loaded serial 8240
Nov 22 17:43:27 my named[5068]: running

despite there was A record for mail.sub.domain.tld. And then mydestination in /etc/postfix/main.cf again becomes = sub, localhost.

This is quite strange. I wonder does anything need to be done on the main server aaa.aaa.aaa.aa? I wonder does simple A-records for "sub.domain.tld" on the main server "domain.tld" delegate DNS management to server bbb.bbb.bbb.bb? For example if I create a sub-sub-server like test.sub.domain.tld it doesn't ping from outside network:

ping: cannot resolve test.sub.domain.tld: Unknown host

only sub.domain.tld pings: PING sub.domain.tld (bbb.bbb.bbb.bb): 56 data bytes 64 bytes from bbb.bbb.bbb.bb: icmp_seq=0 ttl=52 time=19.079 ms 64 bytes from bbb.bbb.bbb.bb: icmp_seq=1 ttl=52 time=28.125 ms

How should I properly delegate DNS management to subdomain (which is configured as main domain on a VPS), so that I could create resolvable sub-sub-servers?

Fri, 11/22/2013 - 20:24
yngens

Recommendation in http://www.virtualmin.com/node/15909 (adding NS record besides A record on main server) doesn't help to make "test.sub.domain.tld" be resolvable from outside network.

Topic locked