In DNS a MX record is like an address book for email servers. It tells other servers where to send emails for a specific domain name. Every domain has its own MX record created on its authoritative DNS server that tells other email servers where to deliver their email.
![](https://wintelhive.com/wp-content/uploads/2023/04/image-120.png)
A MX record contains two important pieces of information.
- The name of the server that should can be used to deliver the email for that domain.
- Priority number that tells servers which server to use first.
It’s must to set up MX records because they help ensure that emails are delivered to the right place. When you set up an MX record, you tell other mail servers which server(s) you want them to use when they try to send emails for your domain.
In this example we are using nslookup to find out the email servers of Gmail. Following is the sequence of commands on command prompt,
- nslookup
- set type=mx
- gmail.com
As a result of these commands followings are the MX records are found for gmail.com.
![Mx Record](https://wintelhive.com/wp-content/uploads/2023/04/image.png)
Based upon the above outcome, the sending email server will try to connect the SMTP with following order. Since the preference is 5,10,20,30,40.
- gmail-smtp-in.l.google.com (Preference 5)
- alt1.gmail-smtp-in.l.google.com (Preference 10)
- alt2.gmail-smtp-in.l.google.com (Preference 20)
- alt3.gmail-smtp-in.l.google.com (Preference 30)
- alt4.gmail-smtp-in.l.google.com (Preference 40)
Why multiple MX Record
Now the questions arises why we need multiple records. Answer is simple, if first email server is down and unable to receive the email, the sending server will retry to send email to 2nd or third server and so on. Incase non of the servers is available for email delivery, the sending server will keep the email in it queue and retry after some time. If none is reachable for a long period of time, sending server may discard the email (depending of sending email server policy) and generate a non delivery alert for the sender.
Another and relatively easier way to run for mail server loookup of Gmail in single line is “nslookup -q=mx gmail.com”. Following is the output.
![mx record in one command](https://wintelhive.com/wp-content/uploads/2024/04/nslookup-q-mx.png)
If you want to make your life more easy. Web based GUI tools are also available to query MX record of domain. Go to “http://pingstage.com“. Type the domain name. Select MX in record type and click lookup.
![web based](https://wintelhive.com/wp-content/uploads/2024/03/image-5.png)
It will bring the MX records for you.
![web based output](https://wintelhive.com/wp-content/uploads/2024/04/image-2.png)
-
DNS Conditional Forwarder
By default name servers resolve the queries using their own zone file. Or use root hints in case of internet….
-
Free DNS Monitoring Without Tool
DNS monitoring is essential for any corporate network. You will find a lot of tools out there in the market…
Leave a Reply