Juggling with MX records

Juggling with MX records

Post by Dave » Thu, 24 Feb 2005 00:35:05



Hello guys and gals,

I wonder if anyone can help me figure this out. I'm trying to plan email
routes for a domain which is registered with Network Solutions.

DNS is managed at NetSol, website is hosted at a VPS, with Linux and qmail
for mail, with another hosting company. We will have a Unix server in-house
with two static IPs through two ISPs, which the Unix box will use to connect
to WAN. At NetSol, I want to set up MX records pointing to three IPs:
mail1.domain.com    (10)    first IP of Unix box
mail2.domain.com    (20)    second IP of Unix Box
mail3.domain.com    (30)    IP of Linux VPS

When the mail arrives I want for it to try the mail1 and mail2 servers
first. If they are down, I want the mail to go to mail3 server.
What I want to achieve is, at the Linux VPS, I want to set up local DNS, or
set-up qmail so that when the mail3 server accepts mail, it will keep trying
mail1 and mail2 servers. I spoke to the hosting company and they told me
that since the DNS is managed by NetSol, this can not be done, but I'm not
fully convinced since we have full contol with root access to the VPS.

Any suggestions as to how this can be done?

Many thanks,

Dave

 
 
 

Juggling with MX records

Post by chris-use.. » Thu, 24 Feb 2005 02:24:53



> DNS is managed at NetSol, website is hosted at a VPS, with Linux and qmail
> for mail, with another hosting company. We will have a Unix server in-house
> with two static IPs through two ISPs, which the Unix box will use to connect
> to WAN. At NetSol, I want to set up MX records pointing to three IPs:
> mail1.domain.com    (10)    first IP of Unix box
> mail2.domain.com    (20)    second IP of Unix Box
> mail3.domain.com    (30)    IP of Linux VPS

Seems plausible so far.

Quote:> When the mail arrives I want for it to try the mail1 and mail2 servers
> first. If they are down, I want the mail to go to mail3 server.

Decreasing MX values, like you've shown above, will do this.

Quote:> What I want to achieve is, at the Linux VPS, I want to set up local DNS, or
> set-up qmail so that when the mail3 server accepts mail, it will keep trying
> mail1 and mail2 servers.

You shouldn't need to worry about that within DNS - it's a mailer
configuration issue. For example, in sendmail, you can tell it to retry
lower valued MX records automatically. I would hope there are similar
things in other MTAs.

However, since you're talking about using qmail, take a look at
http://www-dt.e-technik.uni-dortmund.de/~ma/qmail-bugs.html, with
particular reference to section 3.2. I have no idea whether qmail-1.03
is the most uptodate as I prefer exim and sendmail.

If you really need to resolve this via DNS, take a look at the "views"
keyword in the bind documentation. It allows you to provide different
zone files for different sets of IP addresses. (In your case you could
provide a subset of your primary DNS for your mail host, which omits
the MX details for mail3. Ugly but fairly effective.)

Chris

 
 
 

Juggling with MX records

Post by Dave » Fri, 25 Feb 2005 01:26:57


Chris,

Thank you for a valuable feedback. Can you elaborate a little more on DNS
solution?:

Quote:> (In your case you could provide a subset of your primary DNS for your mail
> host, which omits
> the MX details for mail3.)

Do you mean I should create something like: backupmail.domain.com zone? How?
I looked at /etc/named.conf. Should I add the following?:
zone "backupmail.domain.com" {
        type slave;
        file "domain.com"; // where should this file be located?
        allow-transfer {
                0.0.0.0; //which IPs go here?
                common-allow-transfer;

Quote:};

Where do I create the subset, is the part I'm not sure about.

Thank you,

Dave



>> DNS is managed at NetSol, website is hosted at a VPS, with Linux and
>> qmail
>> for mail, with another hosting company. We will have a Unix server
>> in-house
>> with two static IPs through two ISPs, which the Unix box will use to
>> connect
>> to WAN. At NetSol, I want to set up MX records pointing to three IPs:
>> mail1.domain.com    (10)    first IP of Unix box
>> mail2.domain.com    (20)    second IP of Unix Box
>> mail3.domain.com    (30)    IP of Linux VPS

> Seems plausible so far.

>> When the mail arrives I want for it to try the mail1 and mail2 servers
>> first. If they are down, I want the mail to go to mail3 server.

> Decreasing MX values, like you've shown above, will do this.

>> What I want to achieve is, at the Linux VPS, I want to set up local DNS,
>> or
>> set-up qmail so that when the mail3 server accepts mail, it will keep
>> trying
>> mail1 and mail2 servers.

> You shouldn't need to worry about that within DNS - it's a mailer
> configuration issue. For example, in sendmail, you can tell it to retry
> lower valued MX records automatically. I would hope there are similar
> things in other MTAs.

> However, since you're talking about using qmail, take a look at
> http://www-dt.e-technik.uni-dortmund.de/~ma/qmail-bugs.html, with
> particular reference to section 3.2. I have no idea whether qmail-1.03
> is the most uptodate as I prefer exim and sendmail.

> If you really need to resolve this via DNS, take a look at the "views"
> keyword in the bind documentation. It allows you to provide different
> zone files for different sets of IP addresses. (In your case you could
> provide a subset of your primary DNS for your mail host, which omits
> the MX details for mail3. Ugly but fairly effective.)

> Chris

 
 
 

Juggling with MX records

Post by chris-use.. » Fri, 25 Feb 2005 21:49:12


D> Thank you for a valuable feedback. Can you elaborate a little more on DNS
D> solution?:

c> (In your case you could provide a subset of your primary DNS for your mail
c> host, which omits
c> the MX details for mail3.)

D> Do you mean I should create something like: backupmail.domain.com zone? How?

Not quite. Your "public" domain example is domain.com, and you have three
MX records in it for mail1.domain.com, mail2, and mail3. It's this same
domain for which you will want to create alternative views.

Create a bind "view" on your DNS controller(s) that tells your mail3 host
different information to that which is given to everyone else. The view
is for the same domain (domain.com) but it contains a different zone file.

Example named.conf showing two views for the same "domain.com" domain.
If the requestor's IP address matches the MAIL3 match-clients criteria
it will use that set of zone files. Otherwise it will check the EXTERNAL
match-clients criterion and find it can use that.

    view "MAIL3" {
        match-clients {
            127.0.0.1/8;                // Only if DNS host is mail3
            192.168.130.1/32;           // IP address of mail3
        };

        zone "." { ... };             // As usual

        zone "localhost" { ... }      // As usual
        zone "127.in-addr.arpa" { ... }       //  "  "
        //                                 Etc.

        zone "domain.com" {
            type master;
            file "/etc/bind/mail3/domain.com";
        }
    }

    view "EXTERNAL" {
        match-clients {
            "any";                    // Everyone else
        };

        zone "." { ... };             // As usual

        zone "localhost" { ... }      // As usual
        zone "127.in-addr.arpa" { ... }       //  "  "
        //                                 Etc.

        zone "domain.com" {
            type master;
            file "/etc/bind/public/domain.com";
        }
    }

Chris

 
 
 

1. Solaris 2.3 sendmail.mx not using MX records

My sendmail won't use MX records to route mail. I'm using the
/usr/lib/sendmail.mx but it tries to send directly to a hostname.
Machine is the NIS(not +) and DNS server. I can resolve hostnames outside
of my domain so the machine is using DNS. I use a mail relay and all
mail outside of my domain get routed to this machine which works fine.
It doesn't need a mail relay - it has Internet access. I used the
/etc/mail/main.cf as a starting point for sendmail.cf. What I'm I
doing wrong? Any help would be appreciated.

Andrew Castillo
Varian Associates, Inc.
phone: 1.415.424.6038

2. xinetd and inetd

3. Q: MX records for UUCP host

4. Canon BJ-200 & Linux?

5. Q: MX-Records für Hosteintr?ge ?

6. which type of workstation to purchase?

7. Q. MX RECORD - ROUTING

8. US-TX-HOU Unix System Administrator

9. Need a Backup Mail Relay (MX Record)

10. Config sendmail.cf for MX record?

11. sendmail and DNS MX records

12. Question about spanning mx records

13. Problem with DNS MX records...