Say you own a abcd.com
and you only want to use it to send and receive email via [email protected]
. You don't want to provide any kind of website.
Can you set up the DNS records to include an "MX" record and no "A" record?
Is this enough for sending and receiving email to work?
Is this valid in terms of whatever standard defines these things?
Edit: To clarify, the mail server (terminology?) would not be hosted on abcd.com or *.abcd.com
As long as the system pointed at by the MX record has an A record itself, then yes.
For example:
example.com
can have a MX record pointing atmail.otherdomain.com
. As long as the name mail.otherdomain.com itself is resolvable to an IP address, this is a valid configuration forexample.com
.Strictly speaking,
mail.otherdomain.com
should be an A record with the IP address in order to be RFC-compliant. But this A record will be in theotherdomain.com
domain, not inexample.com
.Addressing your example, in order for
[email protected]
to be a valid email address,mail.otherdomain.com
needs to be configured to handle inbound mail for[email protected]
.NO. The MX record points to a name. The names must be resolvable (via A record). The MX record should never point to a CNAME (RFC 1034 section 3.6.2, RFC 1912 section 2.4)
It is possible - if mail over IPv6 ONLY is desired - as the AAAA record pointed at by the MX record satisfies the address target requirement. Granted, IPv4-only hosts won't be able to contact such a setup, but that doesn't make it illegal under DNS rules.
Why were all the prior answers so IPv4-centric?
Three ways to do this.
I do this on an IP/DN that uses a server's postfix virtual mail account. I didn't want my IP/DN to go to the virtual mail site's webpage. The above methods prevent that. Someone can pull the server's DN out of any received full mail headers and go there via that DN, however.