Checking MX Records

If you ever stumble upon problems with MX records (like I did), nslookup may be your friend.

Basic command is easy:

nslookup -q=MX jmedved.com
Server:  ***
Address:  ***

Non-authoritative answer:
jmedved.com     MX preference = 10, mail exchanger = mail.jmedved.com
jmedved.com     MX preference = 21, mail exchanger = mail2.jmedved.com

jmedved.com     nameserver = ns2.mojsite.com
jmedved.com     nameserver = ns1.mojsite.com
mail2.jmedved.com       internet address = 89.201.164.205
mail.jmedved.com        internet address = 89.201.164.205
ns1.mojsite.com internet address = 89.201.164.100
ns2.mojsite.com internet address = 69.41.243.243

This will print information from your default DNS server, but since DNS information is not propagated immediately, you may wish to check what appropriate server has to say. Just append name of DNS server in charge for given domain (nameserver field) to existing command:

nslookup -q=MX jmedved.com ns1.mojsite.com
Server:  ***
Address:  ***

Non-authoritative answer:
jmedved.com     MX preference = 20, mail exchanger = alt2.aspmx.l.google.com
jmedved.com     MX preference = 30, mail exchanger = aspmx2.googlemail.com
jmedved.com     MX preference = 30, mail exchanger = aspmx3.googlemail.com
jmedved.com     MX preference = 30, mail exchanger = aspmx4.googlemail.com
jmedved.com     MX preference = 30, mail exchanger = aspmx5.googlemail.com
jmedved.com     MX preference = 10, mail exchanger = aspmx.l.google.com
jmedved.com     MX preference = 20, mail exchanger = alt1.aspmx.l.google.com

jmedved.com     nameserver = ns1.mojsite.com
jmedved.com     nameserver = ns2.mojsite.com
aspmx4.googlemail.com   internet address = 209.85.219.1
aspmx5.googlemail.com   internet address = 74.125.45.27
aspmx.l.google.com      internet address = 209.85.220.30
alt1.aspmx.l.google.com internet address = 209.85.216.97
alt2.aspmx.l.google.com internet address = 209.85.199.27
aspmx2.googlemail.com   internet address = 209.85.135.27
aspmx3.googlemail.com   internet address = 209.85.199.27
ns2.mojsite.com internet address = 69.41.243.243
ns1.mojsite.com internet address = 89.201.164.100

That gives you information fresh from the source.

You may wish to check information from all DNS servers for your site. It can happen that only primary DNS is updated with new information while secondary one has old one. This can lead to hard-to-track bugs since everything works properly but occasionally (when secondary DNS is queries) everything goes awry.