Solved

Misconfigured Secondary MX Record

Posted on 2009-05-19
8
742 Views
Last Modified: 2013-11-30
Hi Experts
Recently silly old me added a Secondary MX record as a backup in case the primary goes down.  I figure that since the primary has the higher priority that the secondary would not come into play unless the primary was unreachable.  My small screwup came about when I misconfigured the address of the secondary MX record.   Now it seems we are bouncing about 50% or more of our emails.  I think this is the cause because it is the only thing I can think of that I have changed.

I am seeking clarification here.  I was under the assumption that only the primary MX record would be used unless it were offline.  I have read that the secondary is used regardless in a type of round robin fashion along with the primary.

Thanks
0
Comment
Question by:omfgwtflolbbq
[X]
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
  • 3
  • 3
  • 2
8 Comments
 
LVL 71

Expert Comment

by:Chris Dent
ID: 24420752

Offline or Busy. If your Primary is a bit too busy to listen to an inbound SMTP request the secondary would be used.

When you say higher priority... you do mean a lower numeric value for the Primary, right? e.g.

domain.com.  MX  10  PrimaryServer
domain.com.  MX  50  SecondaryServer

Chris
0
 

Author Comment

by:omfgwtflolbbq
ID: 24427837
Hi Chris
My primary is definitely not too busy.  Network utilisation in under 1%.
Yes my primary is set with a lower numeric value for higher priority in my case it is:

mail.mydomain.com MX 50 PrimaryServer
mail0.otherdomain.com MX 75 SecondaryServer
mail0.hostingcompany.com MX 150 TertiaryServer

So back to my original query.  What is the nature of MX Records? Is it:

1) All mail is directed to primary unless primary is unreachable.
or
2) Other MX servers are used in a round robin fashion with slight preference given to the primary.

Thanks

0
 
LVL 4

Expert Comment

by:Adraenyse
ID: 24427855
Chances are what is happening is a host who does not have your MX records cached is putting out a query for your MX record, receiving it, then putting out a DNS A record query to get the IP addresses for your MX servers, then receiving the secondary's IP first, and going with it. (Or having the first IP time out for some reason).

The priorities are normally (And I say normally) taken into account, given that all other systems are normal. That means, no trouble looking up all the IP's, no expired records (your SOA on your secondary MX record IP may have had a longer retry for example), etc. etc.

Then there is system administrators out there who like to do things against the RFC's, such as ignore SOA timings in DNS and force their own.

So, what it comes down to is, if you have two MX's listed, you'll get mail across both of them, even if the primary is up.
0
Turn Insights into Action

Communication across every corner of your business is essential to increase the velocity of your application delivery and support pipeline. Automate, standardize, and contextualize your communication processes with xMatters.

 

Author Comment

by:omfgwtflolbbq
ID: 24428240
Hi Adraenyse
What you are saying seems to make sense.  That coupled with the fact that the secondary is has a listing in an RBL probably doesn't help either.  I called the secondary about the issue and they suggested that I set the primary with Priority 0.  They seemed to think that with a priority of 0 all email will go to the primary and will avoid the round robin situation.  Adraenyse can you verify this?
Last comment before points awarded.
0
 
LVL 71

Accepted Solution

by:
Chris Dent earned 300 total points
ID: 24429707

Obviously you can't account for mail servers that don't follow RFCs but...

> then receiving the secondary's IP first

That just won't happen if we're following RFCs for MX lookups by the SMTP service.

> your SOA on your secondary MX record IP may have had a longer retry for example

The SOA Record is used to indicate which server is Primary for a given domain. The Retry Interval (in the SOA) has no impact on anything to do with MX Records. It is used by Secondary DNS Servers to figure out when they should retry a Zone Transfer after a transfer has failed.

> What is the nature of MX Records?

It's this one:

1) All mail is directed to primary unless primary is unreachable.

But it gets hazy when you try to define "unreachable". You cannot control the network between the sender and your server. Adverse network conditions may cause a connection failure (or a slow connection), and in that instance it will fall onto the next MX.

If everything was perfect then your primary MX would get all the mail, but it just isn't ever perfect. As such, all servers listed in the MX record should be able to handle inbound mail for a domain, either for direct delivery or further routing.

> seemed to think that with a priority of 0 all email will go to the primary

Makes no difference. The lowest numeric value is preferred, but 0 doesn't have a special function here (if we're following RFCs).

The process is defined here in RFC 2821 under "5. Address Resolution and Mail Handling":

http://www.ietf.org/rfc/rfc2821.txt

With a bit of quoting...

   "To provide reliable mail transmission, the SMTP client
   [(the sending server)] MUST be able to try (and retry)
   each of the relevant addresses in [the MX] list in order,
   until a delivery attempt succeeds."

And:

   "Multiple MX records contain a preference indication that MUST be used
   in sorting (see below).  Lower numbers are more preferred than higher
   ones."

Chris
0
 
LVL 4

Assisted Solution

by:Adraenyse
Adraenyse earned 200 total points
ID: 24433680
I'll clarify my point about SOA records. His secondary is using a different domain name than his primary. If the host who is sending him email happens to have an expired cache or no cache for the primary, but happens to still have a cached record for the secondary, the host may prefer the secondary since it already holds the record. Again, it all comes down to however the sysadmin on the hosts end has chosen to setup the DNS server.

Setting a priority of 0 will have no effect vs. a priority of 10, other than it is still lower and in theory the preferred server. As Chris quoted above, the mail server will try them all in order until it gets a delivery confirmation -- so 0 or 10, it will still be looked up first, tried first, fail first, etc. under conditions where servers are programmed to follow RFC rules.

All this RFC quoting aside... your original question was "I was under the assumption that only the primary MX record would be used unless it were offline. The answer is in my first comment: "If you have two MX's listed, you'll get mail across both of them, even if the primary is up."

0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 24434608

> the host may prefer the secondary since it already holds the record.

It shouldn't, that would breach the RFC that defines the process for the use of MX records.

I don't object to your summary, I agree with it. I disagree with the reasoning given for it to fail over to the secondary server, but that's by-the-by really.

Chris
0
 

Author Closing Comment

by:omfgwtflolbbq
ID: 31583779
Finally the discussion I was after.  Thankyou for citing references and examples.  My experience is that RFC's aren't being followed and mail is delivered across all MX records.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Most DNS problems are VERY easily troubleshot and identifiable if you can follow the steps a DNS query takes. I would like to share the step-by-step a DNS query takes from the origin to the destination. _____________________________________________…
BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

696 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