MX Record in zone file

Kevin Darcy kcd at daimlerchrysler.com
Mon Jun 19 22:59:21 UTC 2000


Alex Shi wrote:

> Helo,
>
> Recently I am adding a eMall feature to my web services. This eMall is
> supported by eCongo, a eCommerce company which provides a kind of
> eCommerce Engine. With this new feature, merchant can setup online
> store with my root domain name. Say my domain is mydomain.com, and
> merchant can have a store like <merchant>.mydomain.com. Because their
> stores are not hosted at my site but eCongo, so a CNAME are required to
> be added into my DNS zone file. And more, for the merchant can receive
> email with the store's name, something like
> info@<merchant>.mydomain.com, MX records must be added to my DNS zone
> file.
>
> The CNAME record is as below:
> *.mydomain.com IN CNAME vs.c1.ecooem.com
>
> and the MX records as:
> @ MX 10 entms002.econgo.com
> @ MX 20 entms001.econgo.com
>
> For the CNAME, my hosting provider does not allow wildcard, so I have
> to have the CNAME record setup spesific for each store. Anyway this can
> be a solution.
>
> For the MX records, I am not vey sure if there will be any problem with
> my email address. The MX records are used for merchants' email address
> redirection, say all the email with address like
> @<whatevermerchant>.mydomain.com will be forwarded to eCongo.

If <merchant>.mydomain.com is a CNAME to something, then you can't also
have it be an MX record, since CNAMEs don't co-exist with other record
types. If you want all of the merchants' email to go to your web server
(or eCommerce engine, or whatever), then technically you don't even
_need_ MX records, since the aliasing function of the CNAME works just as
well for mail delivery as it does for HTTP (although it's a little
inefficient since many mailservers will attempt an MX lookup first).
Assuming, though, that the mail should go somewhere else, then you'll have
to use an A record for each <merchant>.mydomain.com name. Then you can
also add an MX record with the same name, pointing to the appropriate mail
server for the merchant.

> But how
> about my own email? I myself have some emails like xxxx at mydomain.com,
> will they be also forwarded to eCongo?

According to the MX records you show above, mail for the domain name
should go to entms002.econgo.com, and if that mail server is unreachable,
to entms001.econgo.com. Is that where you want it go?

> I totally know nothing about MX syntax.

The syntax of an MX record is: {name} "mx" {preference} {target} (I'm
leaving out optional items like "class" and "TTL" of course). The
{target} is the *real* name of the mail server, which must have a
corresponding A record somewhere; you can't put an IP address or a
CNAME there. {preference} is numeric (0-65535). It is meaningless -- but
must still be present -- if you only have one MX record for a name (just
pick a number). For multi-valued MX records, the values of
{preference} determine the order in which the mail servers are tried: if
they're different, then the mail servers whose MX records have lower
preference values are tried before ones whose MX records have higher
preference values; if the preference values are all the same, then the
load is split randomly between the mail servers.


- Kevin






More information about the bind-users mailing list