Checking MX Records

If an email server needs to deliver email to an email address that doesn't reside on the same server as the sending email server, it will first check to determine if a mail exchanger (MX) record exists for the domain that appears as part of the email address. E.g., suppose you have a server that needs to deliver email to bob@example.com, then the sending server will perform a Domain Name System query to check for any MX records for example.com. If there are no MX records, it will assume email should be delivered to the IP address for example.com. But, if there are MX records, it will use the one with the lowest number for "preference" to first attempt delivery of the email. If it can't reach that server, it will then move on to a server with a higher preference until it can reach a designated email server for the domain or runs out of designated servers.

You can check for MX records yourself using the nslookup tool that is usually found on Unix, Linux, OS X, and Microsoft Windows systems. The examples below were run on a Linux system, but the command and its parameters are the same on the other operating systems as well.

Suppose I want to check on whether any MX records exist for example.com using nslookup. I could use the command nslookup -querytype=mx example.com:

$ nslookup -querytype=mx example.com
Server:         10.255.176.37
Address:        10.255.176.37#53

Non-authoritative answer:
example.com     mail exchanger = 10 example.com.

In the above case, I see there is only one MX record. It has a preference of 10 and points to example.com, so an email server would then look up the IP address for example.com and attempt to deliver email to that IP address for example.com email addresses. In the example above, the "Server" and "Address" lines show the DNS server that was used to look up the information.

Designated email servers for a domain don't necessarily have to be within the domain. A domain owner can use email services provided by an email service provider for instance. E.g., in the example below, GoDaddy email servers have been designated to handle incoming email for the domain checkebola.com. Any email server attempting to deliver email to any address within that domain would first attempt to contact smtp.secureserver.net and, if that system isn't reachable, would then attempt to deliver email to a checkebola.com email address via mailstore1.secureserver.net.

 $ nslookup -querytype=mx checkebola.com
Server:         10.255.176.37
Address:        10.255.176.37#53

checkebola.com  mail exchanger = 0 smtp.secureserver.net.
checkebola.com  mail exchanger = 10 mailstore1.secureserver.net.

Some large email service providers will have many email servers that can accept email. E.g., if you perform an nslookup for gmail.com, you will see something similar to the following:

$ nslookup -querytype=mx gmail.com
Server:         207.255.176.37
Address:        207.255.176.37#53

Non-authoritative answer:
gmail.com       mail exchanger = 20 alt2.gmail-smtp-in.l.google.com.
gmail.com       mail exchanger = 40 alt4.gmail-smtp-in.l.google.com.
gmail.com       mail exchanger = 5 gmail-smtp-in.l.google.com.
gmail.com       mail exchanger = 10 alt1.gmail-smtp-in.l.google.com.
gmail.com       mail exchanger = 30 alt3.gmail-smtp-in.l.google.com.

Authoritative answers can be found from:
gmail.com       nameserver = ns2.google.com.
gmail.com       nameserver = ns1.google.com.
gmail.com       nameserver = ns3.google.com.
gmail.com       nameserver = ns4.google.com.
alt2.gmail-smtp-in.l.google.com internet address = 74.125.24.27
alt4.gmail-smtp-in.l.google.com internet address = 173.194.65.27
gmail-smtp-in.l.google.com      internet address = 173.194.204.27
alt3.gmail-smtp-in.l.google.com internet address = 74.125.71.27
ns2.google.com  internet address = 216.239.34.10
ns1.google.com  internet address = 216.239.32.10
ns3.google.com  internet address = 216.239.36.10
ns4.google.com  internet address = 216.239.38.10

 

TechRabbit ad 300x250 newegg.com

Justdeals Daily Electronics Deals1x1 px

Valid HTML 4.01 Transitional

Created: