0

I need to make an "MX chain" as the following:

@alias.mydomain.net --> @mail.mydomain.net --> @smtp.targetdomain.net
         (1)                     (2)                      (3)
  • Say an SMTP server exists at smtp.targetdomain.net:

    $ host smtp.targetdomain.net
    smtp.targetdomain.net has address 1.2.3.4
    
  • Say my own domain name is mydomain.net. Currently, the jump between (2) and (3) works with the following configuration:

    mail 10800 IN MX 1 smtp.targetdomain.net.
    

    Let's check it:

    $ host mail.mydomain.net
    mail.mydomain.net mail is handled by 1 smtp.targetdomain.net.
    

    An email sent to foo@mail.mydomain.net is received.

  • But the jump between (1) and (2) doesn't work with the following configuration:

    alias 10800 IN MX 1 mail
    mail 10800 IN MX 1 smtp.targetdomain.net.
    

    Let's check it:

    $ host alias.mydomain.net
    alias.mydomain.net mail is handled by 1 mail.mydomain.net.
    

    An email sent to foo@alias.mydomain.net is not received, and a delivery failure mail is sent back to the sender:

    < #5.0.0 smtp; 5.1.2 - Bad destination host "DNS Hard Error looking up alias.mydomain.net (MX): all A records of the domain's MX records are invalid" (delivery attempts: 0)> #SMTP#

Is it possible to make such an MX record chain? Do I need to use the following configuration instead?

alias 10800 IN MX 1 smtp.targetdomain.net.
mail 10800 IN MX 1 smtp.targetdomain.net.
Morgan Courbet
  • 113
  • 1
  • 1
  • 6

1 Answers1

2

No, this is not possible. An MX entry must point to a host with an A record that actually handles mail. There will be no further lookups to check if the target of an MX record has an MX of itself.

You need to set

alias 10800 IN MX 1 smtp.targetdomain.net.

just like with mail.

However, you can have MX records for all records in a domain and don't need to create one for every A record, so I don't see what you want to achieve anyway.

Sven
  • 98,649
  • 14
  • 180
  • 226