When it comes to sending emails, the journey from the sender's inbox to the recipient's inbox can sometimes be a challenging one. Email delivery is dependent on various factors, and one of these factors is a MX record that acts as a guarantor of a successful transmission of an email to its intended destination. It is important for anyone who wants to enhance their mail delivery and ensure that their messages don't get lost in cyberspace.
An MX or Mail Exchange record is a crucial component in the process of email forwarding. In the previous article we shed light on what a DNS (Domain Name System - a storage of information about domains) is and its role in mail delivery and mail security. MX record is a variety of a DNS record which finds an authorized receiving mail sever for the domain specified in the To-field of the header. The information about the receiving email server is specified in the record by the host. In simple words, an MX record acts as a roadmap for emails, telling them where they should go to reach their destination. It serves as a crucial piece of information that helps email servers determine where to deliver incoming messages.
MX records have the following view:
example.net. 3600 IN MX 20 mailserver1.example.net.
example.net. 3600 IN MX 30 mailserver2.example.net.
In this example:
MX records also use A or AAAA (depending on the IP version) records. An A record contains an IP address of the target domain.
Configuring MX records in a proper way allows ensuring a smooth routing process and delivery. Here are a few reasons why they are important:
HOW IT WORKS
The direct purpose of a MX record is to find an appropriate exchange server for the domain by its IP to provide a successful delivery of an email from the sender to the recipient mentioned in the To-field of the message. If you have just set up a new MX record and you need to see how it works or for some other reasons, it is possible to do MX record check. It can be done with the help of various online tools and commands. Here are a few of them:
Open the command prompt or terminal and enter the command "nslookup -type=MX domainname.com".
usr@usr-lap:~$ nslookup -type=MX gmail.com
When you replace "domainname.com" with your actual domain name (gmail.com in the example given above), you'll see the MX records associated with your domain.
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
gmail.com mail exchanger = 5 gmail-smtp-in.l.google.com.
gmail.com mail exchanger = 30 alt3.gmail-smtp-in.l.google.com.
gmail.com mail exchanger = 10 alt1.gmail-smtp-in.l.google.com.
gmail.com mail exchanger = 20 alt2.gmail-smtp-in.l.google.com.
gmail.com mail exchanger = 40 alt4.gmail-smtp-in.l.google.com.
You can use our MX Records lookup application
If you have access to a Linux or Mac system, you can use the "dig" command to check MX records: "dig MX domainname.com".
usr@usr-lap:~$ dig MX gmail.com
When you replace "domainname.com" with your actual domain name (gmail.com in the example given above), you'll see the MX records associated with your domain.
; <<>> DiG 9.18.12-0ubuntu0.22.04.1-Ubuntu <<>> MX gmail.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50633
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;gmail.com. IN MX
;; ANSWER SECTION:
gmail.com. 1790 IN MX 10 alt1.gmail-smtp-in.l.google.com.
gmail.com. 1790 IN MX 30 alt3.gmail-smtp-in.l.google.com.
gmail.com. 1790 IN MX 40 alt4.gmail-smtp-in.l.google.com.
gmail.com. 1790 IN MX 5 gmail-smtp-in.l.google.com.
gmail.com. 1790 IN MX 20 alt2.gmail-smtp-in.l.google.com.
;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Fri May 26 23:00:54 MSK 2023
;; MSG SIZE rcvd: 161
Checking MX records is important to ensure that they are correctly configured and pointing to the desired mail servers. If you encounter any issues or discrepancies, you can contact your domain registrar or hosting provider for assistance in resolving the problems.
While MX records are relatively straightforward to set up, there are some common misconfigurations and issues that can affect email delivery. Let's take a look at a few of them:
Frequently asked questions
If your MX records are misconfigured, email delivery can be affected. Emails may bounce back, get marked as spam, or fail to reach their intended recipients.
Yes, you can have multiple MX records for redundancy. By specifying multiple mail servers with different priority values, you ensure that emails are delivered even if one server is unavailable.
MX record changes usually propagate within a few hours, but it can take up to 48 hours for the changes to fully propagate across the internet. During this time, emails may still be delivered to the old mail servers.
Changing MX records can impact email delivery if not done correctly. It is recommended to consult with your domain registrar or hosting provider for assistance in making the necessary changes.
MX records play a role in email security through mechanisms like SPF and DKIM. Properly configured MX records contribute to enhanced email security and help prevent spoofing and phishing attempts.
No, MX records require the use of domains and cannot be directly specified with an IP address. MX records point to the A or AAAA records of the mail servers, which then map to the IP addresses.