Solved

Misconfigured Secondary MX Record

Posted on 2009-05-19
8
728 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
  • 3
  • 3
  • 2
8 Comments
 
LVL 70

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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 70

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 70

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

If you have a multi-homed DNS setup in windows, you can have issues with connectivity to the server that hosts the DNS services (or even member servers of your domain if this same DNS server is a DC). This is because windows registers all of its IPs…
There have been a lot of times when we have seen the need to enter a large number of DNS entries in a forward lookup zone. The standard procedure would be to launch the DNS Manager console, create the Zone and start adding new hosts using the New…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now