Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two domains that both need to use one server that has a dynamic ip address for email. Static IP, A record pointing to the static IP, needs to host e-mail for but use as mail server. Dynamic IP, using DYNDNS to update IP address, hosts e-mail for

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

for I have a CNAME for --> I have a MX record with priority 0 -->

for I have an mx record with priority 10 -->

Should I fix this by having the MX record for point to

share|improve this question
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
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 & .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
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 point the MX record to the A record for the email server in the DNS zone.

MX =

MX =

A = =

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


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.