{"id":1228,"date":"2013-04-04T22:29:39","date_gmt":"2013-04-04T22:29:39","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=1228"},"modified":"2013-04-04T22:29:39","modified_gmt":"2013-04-04T22:29:39","slug":"email-fundamentals-what-is-an-mx-record","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=1228","title":{"rendered":"Email Fundamentals: What is an MX Record?"},"content":{"rendered":"<p>One of the less well understood components of a working email system is the MX record. I do find a lot of IT administrators looking after\u00a0Exchange servers\u00a0who don\u2019t really understand what an MX record is and how they work.<\/p>\n<h2>DNS Fundamentals<\/h2>\n<p>MX stands for \u201cmail exchanger\u201d. An MX record is a type of DNS record, so any understanding of MX records has to begin with an understanding of the fundamentals of the Domain Name System (DNS).<\/p>\n<p>The most important role of DNS for the majority of us is translating names into IP addresses so that network communications can occur.<\/p>\n<p>For example, when you type\u00a0www.microsoft.com\u00a0into your web browser, DNS is used to look up that name to determine the IP address of the server to connect to. The domain name in this example is microsoft.com.<\/p>\n<p>So if that is how a simple web browser connection is made, what about when somebody sends email to an @microsoft.com address?<\/p>\n<p>Again DNS comes into play, but this time the look up is slightly different. The sending mail server will look up the MX record in DNS by following a sequence along these lines:<\/p>\n<ol>\n<li>Look up the authoritative name servers for microsoft.com<\/li>\n<li>Query the microsoft.com name servers for the MX records<\/li>\n<li>Look up the names of the MX records in DNS to get their IP addresses<\/li>\n<\/ol>\n<p>If you were to run your own manual DNS lookup of the MX records for microsoft.com it would look something like this:<\/p>\n<p>&nbsp;<\/p>\n<pre>C:\\&gt;nslookup\r\nDefault Server:  UnKnown\r\nAddress:  10.0.1.9\r\n\r\n&gt; set type=mx\r\n&gt; microsoft.com\r\nServer:  UnKnown\r\nAddress:  10.0.1.9\r\n\r\nNon-authoritative answer:\r\nmicrosoft.com   MX preference = 10, mail exchanger = mail.messaging.microsoft.com\r\n\r\nmail.messaging.microsoft.com    internet address = 94.245.120.86<\/pre>\n<p>So the IP address of the \u201cmail exchanger\u201d for microsoft.com is 94.245.120.86.<\/p>\n<h2>MX Preferences<\/h2>\n<p>You may notice the \u201cMX preference\u201d in the output above and wonder what that is referring to. To better explain it here is another DNS lookup for the google.com domain.<\/p>\n<pre>&gt; google.com\r\nServer:  UnKnown\r\nAddress:  10.0.1.9\r\n\r\nNon-authoritative answer:\r\ngoogle.com      MX preference = 30, mail exchanger = alt2.aspmx.l.google.com\r\ngoogle.com      MX preference = 50, mail exchanger = alt4.aspmx.l.google.com\r\ngoogle.com      MX preference = 40, mail exchanger = alt3.aspmx.l.google.com\r\ngoogle.com      MX preference = 20, mail exchanger = alt1.aspmx.l.google.com\r\ngoogle.com      MX preference = 10, mail exchanger = aspmx.l.google.com\r\n\r\nalt2.aspmx.l.google.com internet address = 74.125.115.27\r\nalt1.aspmx.l.google.com internet address = 74.125.91.27\r\naspmx.l.google.com      internet address = 74.125.157.27<\/pre>\n<p>Notice that there are multiple MX records each with a different preference value. The preference is basically a way of setting the priority of each MX record. The lowest preference is the MX with the highest priority, ie the one that a sending mail server should try first.<\/p>\n<p>The purpose of multiple MX records is to either:<\/p>\n<ul>\n<li>Provide some load balancing by using multiple MX records with the same preference set<\/li>\n<li>Provide a backup MX that can be used if the primary one is unavailable<\/li>\n<\/ul>\n<p>The backup MX may be another mail server in your organization at a secondary site that has less bandwidth available to it. Or it could be a server hosted by a third party that provides backup MX services. Either way the purpose is to give sending email systems somewhere to send messages rather than have to store them and retry later.<\/p>\n<h2>Where Should Your MX Records Point?<\/h2>\n<p>Once you understand what an MX record does you then need to consider where your MX record should actually be pointing. Here are a few real world examples of where to point your MX records.<\/p>\n<p>If your organization receives email directly then your MX record would point to a\u00a0public IP address for your firewall or internet-facing email server (eg\u00a0Edge Transport server).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"mx-records-direct\" alt=\"\" src=\"http:\/\/exchangeserverpro.com\/wp-content\/uploads\/2011\/08\/mx-records-direct-600x149.jpg\" width=\"600\" height=\"149\" \/><\/p>\n<p>If your organization uses a hosted cloud service for email filtering, then your MX record would point to their IP address (or an array of IP addresses depending on which service you are using).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"mx-records-cloud\" alt=\"\" src=\"http:\/\/exchangeserverpro.com\/wp-content\/uploads\/2011\/08\/mx-records-cloud-600x149.jpg\" width=\"600\" height=\"149\" \/><\/p>\n<p>Those are just two examples. There are numerous different scenarios that exist such as hybrid cloud\/direct combinations, ge0-distributed networks, and so on. However in my experience these are the two most common scenarios.<\/p>\n<p>By now you should have a basic understanding of what an MX record is and how they work.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the less well understood components of a working email system is the MX record. I do find a lot of IT administrators looking after\u00a0Exchange servers\u00a0who don\u2019t really understand what an MX record is and how they work. DNS Fundamentals MX stands for \u201cmail exchanger\u201d. An MX record is a type of DNS record, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,21,22,7],"tags":[],"class_list":["post-1228","post","type-post","status-publish","format-standard","hentry","category-ms-exchange","category-exchange-2007","category-exchange-2010","category-computer-tech-stuff"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/1228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1228"}],"version-history":[{"count":2,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/1228\/revisions"}],"predecessor-version":[{"id":1230,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/1228\/revisions\/1230"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}