"missing MX and A records" error in logs when trying to send an email to a user

Problem Statement

When trying to send an email to a user, we received the “missing MX and A records” error in the logs.

Steps to reproduce

  1. set up a custom email provider in the tenant and enable the verification email template. With a database connection, complete the sign-up flow with an email address that has a good domain to confirm that your setup is working
  2. With a database connection, complete the sign-up flow with an email address that has a bad domain.
  3. Check Monitoring > Logs for the error: type: "fn" AND details.error: "missing MX and A records"

Troubleshooting

Query the email domain to ensure it has either an MX or A record.

Cause

Before attempting to send an email via SMTP, the system first runs a DNS query to ensure the domain on the recipient’s email address has either an MX or A record to reduce the number of bounced emails. It first checks if the email domain has an MX record. If not, it checks for an A record. If both are missing, this error is returned.

Solution

This error could be:

  • User error - they tried to sign-up, but the domain on their email address included a typo
  • The email administrator didn’t configure the domain on the recipient’s email address properly
  • A malicious user tried to create an account with a bad email address for a phishing attempt.

Please ensure the user’s email domain has set either an MX or A record.

Sample links for how to check the MX and A records:

Failing MX

Successful MX

Failing A

Successful A