Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two domains that both need to use one server that has a dynamic ip address for email.

domain.com: Static IP, A record pointing to the static IP, needs to host e-mail for @domain.com but use domain.biz as mail server.

domain.biz: Dynamic IP, using DYNDNS to update IP address, hosts e-mail for @domain.biz

The way I have it working now, is not supposed to be allowed (Because of an MX record pointing to a CNAME):

for domain.com: I have a CNAME for mail.domain.com --> domain.biz I have a MX record with priority 0 --> mail.domain.com

for domain.biz I have an mx record with priority 10 --> domain.biz

Should I fix this by having the MX record for domain.com point to domain.biz?

share|improve this question
2  
Be warned that more and more systems reject ANY mail coming from a system with dynamic IP addresses, usually without checking anything else. –  John Gardeniers Feb 23 '11 at 1:24

3 Answers 3

up vote 3 down vote accepted

You really don't want a mail server on dynamic IPs, you can't set a PTR(look like spam), its listed as a dynamic IP(big spam flag) and you'll lose emails while DNS is updating. I highly advise you get a static IP or get email service Google apps(which you can get free) is quite nice.

To answer your question just set up 2 A records and point each to something like mail.domain.com & .biz.

share|improve this answer
    
While it can be problematic having an email server on a dynamic ip address, it's not the end of the world. In addition, the MX record should be set with a fairly low TTL, the dynamic ip address is probably not going to change that often, and if it does change emails probably won't be lost as any server with the old MX record cached will try to connect to the old ip address and failing that will retry at a later interval and will more than likely need to perform another MX lookup (based on the low TTL) and get the new MX record. –  joeqwerty Feb 23 '11 at 0:06
1  
Creating 2 A records may seem like a small thing but it actually creates twice the work and twice the management overhead. If the OP creates an MX in each zone that points to an A record in one of the zones then he only needs to manage the one A record when making changes, updates, etc. –  joeqwerty Feb 23 '11 at 0:11

An MX record for a domain doesn't need to point to an A record in the same domain, so for domain.com point the MX record to the A record for the email server in the domain.biz DNS zone.

Domain.com

MX = host.domain.biz

Domain.biz

MX = host.domain.biz

A = host.domain.biz = 1.2.3.4

share|improve this answer

Just setup your mail server on the static address. Your dynamic address should have an MX pointing to this. There is no requirement that the MX be in the same domain tree as the MX. Your MX will need to be configured to know about the two domains. How they are handled will need to be configured, but it appears you are handling that already.

When sending from your dynamic address relay thought the server on the static address, or use your ISP. Dynamic addresses won't have the necessary PTR record to establish trust. Also many dynamic addresses are listed in Spamhaus and other blacklists and will prevent you from sending e-mail. Some sites will refuse you mail if the PTR and A records don't refer to each other (rDNS validation).

If the mail is to be delivered to the host with the dynamic address, relay it through a server on the static address. It should be setup queue mail and authenticate before delivering email. Basically, you will be configuring a backup mail server on the the static address. It will appear as the primary (and only) MX in DNS.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.