How to Add an MX Record for Email

Updated 25 February 2026 9 views DNS & Nameservers

Setting Up MX Records for Email

MX (Mail Exchange) records tell the internet where to deliver email for your domain. Without properly configured MX records, you will not receive any email sent to addresses at your domain.

How MX Records Work

When someone sends an email to you@yourdomain.com, the sending mail server looks up the MX records for yourdomain.com. The MX records specify which mail servers handle email for that domain and in what priority order.

Adding MX Records in DirectAdmin

  1. Log in to DirectAdmin and navigate to DNS Management.
  2. Select your domain and click Add Record.
  3. Set the Type to MX.
  4. In the Name field, enter @ (for the root domain).
  5. In the Value field, enter the mail server hostname (e.g., mail.yourdomain.com.).
  6. Set the Priority (lower numbers = higher priority, e.g., 10).
  7. Click Save.

Common MX Record Configurations

SillyHost Email

  • @ MX 10 mail.yourdomain.com.

Google Workspace

  • @ MX 1 ASPMX.L.GOOGLE.COM.
  • @ MX 5 ALT1.ASPMX.L.GOOGLE.COM.
  • @ MX 5 ALT2.ASPMX.L.GOOGLE.COM.
  • @ MX 10 ALT3.ASPMX.L.GOOGLE.COM.
  • @ MX 10 ALT4.ASPMX.L.GOOGLE.COM.

Microsoft 365

  • @ MX 0 yourdomain-com.mail.protection.outlook.com.

Understanding Priority Values

The priority (or preference) value determines the order in which mail servers are tried:

  • Lower numbers are tried first (higher priority).
  • If the primary server is unavailable, email is delivered to the next server in priority order.
  • Servers with the same priority receive email in a round-robin fashion.

Important Notes

  • When switching email providers, update your MX records and remove the old ones.
  • MX records typically propagate within 1 to 12 hours.
  • Ensure a corresponding A record exists for your mail server hostname.

Was this article helpful?

Let us know so we can improve our docs.