Let us say I have a domain example.com
that points to IP 192.0.2.4
, hence in the DNS I would see:
example.com A 192.0.2.4
www.example.com CNAME example.com
Now, most MX
records appear to be set in this way into the DNS
example.com MX 10 mail.example.com
mail.example.com A 192.0.2.4
Can I just do this?
example.com MX 10 example.com
By leaving out the: mail.example.com A 10 192.0.2.4
P.S. I looked into RFC "3.3.9. MX RDATA format" but it doesn't seem to say much
Yes, of course you can create such an MX record. When all your services are running on a single ip-address and/or a single server and the host that will receive mail for
@example.com
ISexample.com
.There is no requirement to do this:
But in that scenario you can also simply omit creating MX records entirely. When no MX records are found for
@example.com
SMTP will deliver mail directly to the hostexample.com
.See RFC 5321 §5.1