0

I'm sure this is a beginner question, but I could use some help.

I run a VPS and am familiarizing myself with DNS settings and my mailing set up. I began when one email address consistently ended up in the spam folder. I have looked up all major results from tools, and have only a few beginner questions.

My VPS has two name servers, about 6 IP addresses, and multiple sub-accounts. I’m running WHM/cPanel.

My first question is related to MX Records.

For my MX Record, I have listed domain.com for one cPanel account. However, under my mail configuration settings my incoming/outgoing settings list mail.domain.com as the incoming/outgoing server. My question is, should my MX Record and my mail server address be the same, and is it okay for the MX record to be domain.com with no sub-domain?

In my DNS Zone File I have the following (in a different order):

  • domain.com. 14400 IN MX 0 domain.com.
  • mail 3600 IN CNAME domain.com.
  • www 3600 IN CNAME domain.com.
  • webmail 3600 IN A primary_ip_address.

My understanding is that my current MX entry and sub-domain being listed as the mail server is okay, since I have a CNAME record pointing to domain.com. Is this correct?

Other questions:

  • Should I have multiple MX records for domain.com and mail.domain.com?
  • Should I have a second MX record associated with a second domain(to reduce a single point of failure?)
  • I have a www CNAME for the domain, a DNS testing tool said this slows the server?

I have other questions but I’ll stop there for now.

dopeideas
  • 1
  • 1
  • In your questions please refrain from using random domain names and use either your *own domain* or one of the [RFC 6761](https://tools.ietf.org/html/rfc6761#section-6.5) reserved domain names such as `example.com`, `example.org` or similar . Please refer to [this Q&A](http://meta.serverfault.com/q/963/37681) for our recommendations with regards to how and what (not) to obfuscate in your questions. – HBruijn Sep 27 '18 at 09:50

1 Answers1

2

Is it Okay for an MX Record to Differ from Incoming/Outgoing Mail Server Address?

Yes, that is frequently the case. How SMTP servers route email and the settings that users need to configure in their email clients can be different.

My understanding is that my current MX entry and sub-domain being listed as the mail server is okay, since I have a CNAME record pointing to domain.com. Is this correct?

The target in MX records may not be a CNAME record. So the following is indeed correct

example.com.      IN  A    192.168.1.1
example.com.      IN MX 1  example.com.
mail.example.com. IN CNAME example.com. 

But doing this is wrong:

example.com.      IN  A    192.168.1.1
example.com.      IN MX 1  mail.example.com.
mail.example.com. IN CNAME example.com. 

Should I have multiple MX records for example.com and mail.example.com?

You only need MX records for the suffixes you're using for mail. So if you'll be using e-mail addresses such as alice@example.com and bob@mail.example.com (although more frequently subdomain divisions such as @locality.example.com and @subsidary.example.com are used) you'll need :

mail.example.com. IN MX 1  smtp.example.com.
example.com.      IN MX 1  smtp.example.com. 

and if the server on example.com handles your incoming email using example.com. IN MX 1 example.com. is also valid.

The only targets in your MX record should be the unique servers that will handle your incoming email. The following example adds no redundancy, does not satisfy any arcane RFC requirements, it works but makes absolutely no sense:

example.com.      IN MX 1  mail.example.com.
example.com.      IN MX 2  smtp.example.com.
mail.example.com. IN  A    192.168.1.1
smtp.example.com. IN  A    192.168.1.1

Should I have a second MX record associated with a second domain(to reduce a single point of failure?)

In general the SMTP protocol and properly configured smtp servers that send you email are already quite resilient. Messages will be stored by the sender and delivery will be retried when your own incoming mail server is temporarily unavailable.

When your incoming mail server and internet connection are usually available (your connection is for instance not a dial-up connection) a backup MX is probably not necessary.

A backup mail server arguably makes dealing with spam filtering on the primary mail server more difficult as well.

HBruijn
  • 72,524
  • 21
  • 127
  • 192