-   Linux - Server (
-   -   Forcing to use a particular MX (

the_gripmaster 09-11-2008 07:14 AM

Forcing to use a particular MX
Suppose has 2 MX records of identical priority:

MX 10
MX 10

I want to make sure my email server always connects to to send emails to What are the ways I could accomplish this using sendmail?


MensaWater 09-11-2008 09:25 AM

I don't understand what you're trying to do here.

If you always want it to use one mail server simply delete the other one from DNS.

You could make the other mail server relay all its traffic through the first one but if you're sure the first one is always going to be up it seems a little silly to do this. The only benefit I could see is the second mail server would queue up mail while the first one is down.

However, for that scenario you shouldn't give both mail servers the same priority in the first place. Set the first one to "10" and the second one to a higher number like "20". That means all traffic would go the first mail server so long as it was reachable and would only go to the second one when the first one wasn't. That is the whole point in giving them priorities in the first place.

the_gripmaster 09-14-2008 07:44 AM

For this fictitious scenario, is another domain. My domain is I am trying to send emails from my domain to, making sure emails are always delivered to

MensaWater 09-14-2008 09:00 AM


Originally Posted by the_gripmaster (Post 3279940)
For this fictitious scenario, is another domain. My domain is I am trying to send emails from my domain to, making sure emails are always delivered to

You can have separate MX record setup in the two different DNS zone files - one for and one for

That is to say you can create zone file that has ONLY the MX record for
If you then want to allow either mail server to be able to receive for just add both MX record to the zone file.
Both zone files can (and usually would) exist on the same DNS server(s). I

Mr. C. 09-14-2008 04:35 PM

I recall you asking this question previously. And a search reveals this is your third thread asking essentially the same question. The other two are:

Are you not happy with the answers in those threads, so decide to open a new one? I responded to one, where you claimed your Sendmail would always use the lower priority MX, but we discovered your DNS was not working correctly, and you gave up.

Many mail admins configure a fake secondary MX to catch spammers. When their primary is down, you're mail server will keep retrying until the primary comes back up, or your the retry expiration time occurs.

What REAL problem are you trying to solve?

the_gripmaster 09-15-2008 02:17 AM

@Mr. C.

I decided to open this thread because I thought my previous threads did not present the issue clearly. BTW, the DNS for the domain is working okay from my server, I do not know why your dig failed.

Mr. C. 09-15-2008 11:57 AM

DNS servers can sometimes be offline, and this is normal. Also, DNS typically uses UDP queries, which can be dropped/lost for various reasons. What is important is not why DNS failed in the issues we discussed in the other post, but that the failure explains why your sendmail was using a secondardy MX (which you were trying to defeat, by forcing it to use the problematic primary MX).

In Postfix, one can use transport maps that can be specified to bypass the MX lookup for a given remote site; while this is not good practice as a general rule for sites that you do not own, it can be accomplished. I don't recall the mechanism in Sendmail to accomplish this.

All times are GMT -5. The time now is 07:05 PM.