22

Say you own a abcd.com and you only want to use it to send and receive email via bob@abcd.com. 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

1
  • Amusingly, Google now does this routinely. GMail customers with a domain of their own, but without hosting, appear in DNS with a MX record but no A record. The MX record typically points to "aspmx.l.google.com".
    – John Nagle
    Jan 26, 2018 at 1:38

4 Answers 4

35

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 at mail.otherdomain.com. As long as the name mail.otherdomain.com itself is resolvable to an IP address, this is a valid configuration for example.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 the otherdomain.com domain, not in example.com.

Addressing your example, in order for bob@example.com to be a valid email address, mail.otherdomain.com needs to be configured to handle inbound mail for bob@example.com.

4
  • 1
    mail.otherdomian.com MUST be resolvable by A record so this answer is incorrect
    – Jim B
    Jan 6, 2010 at 15:39
  • 6
    The mail-only domain does not require an A record if the MX record points to an A record in another domain. The question is only about the mail-only domain.
    – Ben Doom
    Jan 6, 2010 at 15:53
  • 1
    mail.otherdomain.com will have an A record in the otherdomain.com domain, not in the example.com domain. Jan 6, 2010 at 16:53
  • nb - you can also just have an A record and no MX record and it will default to the A record. Oct 31, 2018 at 5:36
1

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)

5
  • 8
    True an MX records must point to an A record, but it doesn't have to point to one on the same domain. You could have the MX record for example.com pointing to mail.domain.com
    – Sam Cogan
    Jan 6, 2010 at 15:08
  • that's not the question- mail.domain.com MUST have an A record. It's required both by RFC and by definition
    – Jim B
    Jan 6, 2010 at 15:38
  • 1
    Jim -- The question does not specity that the mx record point to the parent domeain. For example, I could point bendoom.com's MX record to Google mail, and have no A records in bendoom.com
    – Ben Doom
    Jan 6, 2010 at 15:52
  • Yes, mail.domain.com must have an A record, however he asked whether he needed an A record in abcd.com, if the MX record for abcd.com is pointing to mail.domain.com (or google.com etc) then he does not need an A record in the abcd.com DNS Zone
    – Sam Cogan
    Jan 6, 2010 at 15:57
  • You are correct, that's what the clarification says NOW but not when I answered the question. There was no mention of another domain. It then goes on to what the standard says. In addition being resolvable does not mean it's a A record. That being said, most mail servers will still submit mail to a CNAME; however, you can't be guaranteed of it.
    – Jim B
    Jan 6, 2010 at 16:45
1

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?

-2

Three ways to do this.

  1. Setup an MXE record. There should be a choice for an MXE record in the domain name server's mail setup section. This way you can point your MX to an actual IP address without creating an @ and www A record.
  2. Again, setup an MXE record. If the domain name server requires an @ and/or www A record anyway, point it to the domain name server's parking page.
  3. Again, setup an MXE record. Then point the @ and www A record to example.com, using the example.com IP address 93.184.216.34. When someone tries to go to your page, they will receive a '404 - Not Found'.

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.

1
  • MXE records are only valid with enom Nov 30, 2016 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.