Understanding MX Records
56 views
DNS & Domains
<h3>How MX Records Route Your Email</h3>
<p>MX (Mail Exchanger) records are DNS records that specify which mail servers are responsible for receiving email on behalf of your domain. When someone sends an email to <code>user@example.com</code>, the sending mail server looks up the MX records for <code>example.com</code> to determine where to deliver the message.</p>
<h3>How MX Records Work</h3>
<p>Each MX record contains two key pieces of information:</p>
<ul>
<li><strong>Priority (Preference):</strong> A numeric value that determines the order in which mail servers are tried. Lower numbers have higher priority.</li>
<li><strong>Mail Server (Value):</strong> The hostname of the mail server that will accept email for the domain.</li>
</ul>
<p>Example MX record setup:</p>
<pre><code>example.com. 3600 IN MX 10 mail.example.com.
example.com. 3600 IN MX 20 backup-mail.example.com.</code></pre>
<p>In this example, mail is first directed to <code>mail.example.com</code> (priority 10). If that server is unavailable, the sending server will try <code>backup-mail.example.com</code> (priority 20).</p>
<h3>Viewing and Editing MX Records in DirectAdmin</h3>
<ol>
<li>Log in to DirectAdmin and go to <strong>Account Manager → DNS Management</strong>.</li>
<li>Look for existing MX records in the list.</li>
<li>To modify an MX record, click on it, update the priority or mail server value, and click <strong>Save</strong>.</li>
<li>To add a new MX record, select <strong>MX</strong> as the record type, enter the priority and the mail server hostname, then click <strong>Add</strong>.</li>
</ol>
<div class="alert alert-warning"><strong>Important:</strong> MX record values must be hostnames, not IP addresses. The hostname must have a corresponding A record that resolves to the mail server's IP address.</div>
<h3>Common MX Configurations</h3>
<ul>
<li><strong>Local mail (server-hosted):</strong> MX points to <code>mail.example.com</code> which resolves to your server's IP.</li>
<li><strong>Google Workspace:</strong>
<pre><code>Priority 1: ASPMX.L.GOOGLE.COM
Priority 5: ALT1.ASPMX.L.GOOGLE.COM
Priority 5: ALT2.ASPMX.L.GOOGLE.COM
Priority 10: ALT3.ASPMX.L.GOOGLE.COM
Priority 10: ALT4.ASPMX.L.GOOGLE.COM</code></pre></li>
<li><strong>Microsoft 365:</strong> MX points to <code>example-com.mail.protection.outlook.com</code> (the exact value is provided in your Microsoft 365 admin panel).</li>
</ul>
<h3>Testing MX Records</h3>
<p>Use online tools such as <a href="https://mxtoolbox.com" target="_blank">MXToolbox</a> to verify your MX records are resolving correctly. You can also use the command line:</p>
<pre><code>dig MX example.com
nslookup -type=MX example.com</code></pre>
Need More Help?
Can't find what you're looking for? Our support team is ready to help.
Contact Support