Domain/DNS A record and MX record

Posted on 2015-02-13
Last Modified: 2015-02-13
Seeking a little clarification please.

When configuring a domain name/DNS, mx records can be setup. E-mails to that domain name are then sent to the mx record. e.g mx1 record, when mail is sent it sees in the mx record and then mail is forwarded to that address.
if a "mail" A record is added to the domain name of this takes priority over the mx record so when mail is sent it first goes to where it is then forwarded to the from the mx record.

Is this correct? essentially the is first address the mail will be sent to and the mx is used once it has arrived?

This would also mean that the mail a record and the mx record can be on different hosts/ip addresses.

Many thanks for your help.

Hope this makes sense!!
Question by:Potts2002
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2

Expert Comment

by:Manoj Bojewar
ID: 40607478
This is wrong. Mail flow only work with  MX record Priority not A record. 1st MX record priority 10 2nd MX record 10.10.10. 2 priority 20

Example, if you have two MX record pointed with two different priority then high Priority records will take care of mail flow, in case first record is down then it will go through second MX record.

Always mail flow through

Author Comment

ID: 40607484
What happens when the mail A record and the mx records are different?

Expert Comment

ID: 40607493
MX records define the mail serving addresses for a domain, a MX record needs an A record to define the mailserver.

There is no such thing as a mail A record, the MX record uses an A record for it's address, if that A record is wrong then the mail will not be delivered to that address as it tries to do so at the wrongly defined address.

For example: A record A record MX 10

Will cause the mail to be delivered at the server. A record A record MX 10

Will cause the mail to be delivered at the server.

Bottomline, A records are like street addresses, MX records are just saying which street addresses have postboxes.
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users


Expert Comment

by:Manoj Bojewar
ID: 40607496
FYI.. You can point MX record either to IP address or A record.  if your MX record is pointed to A record. in case if you change the A record, MX record will also get updated A record IP.

Expert Comment

ID: 40607497
Do not ever point a MX record to an ip address directly, whilst it is possible it is against the RFC and will cause erratic behaviour.

Expert Comment

ID: 40607506
Also, your MX record is not getting updated when you change the A record, the A record is getting updated. Back to the street example, if you change the A record your are basically changing the street address nothing changes with the fact that you own a postbox, the location of the postbox is changed not the fact that you do own a postbox.

Author Comment

ID: 40607517
Thanks DrAtomic.

So if I understand this correctly if a mail is sent it uses the mail A record first, in your analagy the mail goes to the street and then checks with the mx records to find out where the mailbox is.

If this is correct, can e-mails be filtered at the mail. point of the process prior to being delivered to the final mx record destination?


Accepted Solution

DrAtomic earned 500 total points
ID: 40607573
Sending mail is a different story, when delivering mail the following happens:

1. Sending mailserver looks up the nameserver (dns server) that serves the domain.
2. Then the sending mailserver looks up to see if a postbox exists for the domain and to which A record that is linked.
2b. If multiple MX records exist the MX record with the lowest route cost is used (priority figure, i.e. prio 20 is more expensive then prio 10 so the A record of prio 10 is used).

To add a filter layer you can use smart host where you configure the highest cost MX as a backup mailserver for the lower cost MX, then block the incoming public traffic to the lower cost MX so that mailservers are always forced to use the higher cost MX.

Featured Post

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
WARNING:   If you follow the instructions here, you will wipe out your VTP and VLAN configurations.  Make sure you have backed up your switch!!! I recently had some issues with a few low-end Cisco routers (RV325) and I opened a case with Cisco TA…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question