The proper format of an MX record often follows the example below:
yourdomain.com | MX | 1 mail.yourdomain.com |
mail.yourdomain.com | A | 127.0.0.1 |
If you telnet to port 25 of that IP using "telnet mail.yourdomain.com smtp" you should see 220 and then a hostname. If possible, use the hostname from the 220 greeting message rather than inventing a new mail.yourdomain.com name.
If you have a backup mailserver, you might use something like this:
yourdomain.com | MX | 1 mail.yourdomain.com |
yourdomain.com | MX | 2 mail2.yourdomain.com |
mail.yourdomain.com | A | 127.0.0.1 |
mail2.yourdomain.com | A | 127.0.0.2 |
MX records only affect mail delivery. They have no effect on HTTP, FTP, or any other protocol besides SMTP.
NOTES:
- Never point mail.yourdomain.com using a CNAME. You should only use an A record for mail.yourdomain.com.
- The MX number gives the "preference" assigned to that record; lower numbers are preferred. In the "backup mailserver" example above, the sender will try to access mail.yourdomain.com before it tries mail2.yourdomain.com, since the former uses a lower MX number (1) than the backup (2). 10 is a default value that many people use, but you may certainly use a different number.