Exercise: Checking a Domain’s Mail Server with nslookup

In this lesson, we'll use nslookup to look up a domain's mail server.

We'll cover the following

nslookup

nslookup, or name server lookup, is a command-line tool that can be used to find the name and IP address of the SMTP server for a domain like live.com or gmail.com. Have a look at the following command.

Outlook

Press + to interact
nslookup -type=mx https://outlook.live.com

The mx in the -type=mx flag stands for Mail Exchanger record, which essentially means the SMTP server.

There is a lot more that nslookup can be used for. Here’s the manpage for nslookup if you want to learn more.

Ignore what authoritative and non-authoritative mean for now. You’ll understand them when we get to DNS.

Try any other domain of your choice! Here are a couple of very popular ones.

Gmail

Press + to interact
nslookup -type=mx gmail.com

In this case, one of the SMTP servers for Gmail is alt1.gmail-smtp-in.l.google.com.

Yahoo!

Press + to interact
nslookup -type=mx mail.yahoo.com

Let’s study pull protocols like POP and IMAP in some detail in the next lesson.

Get hands-on with 1400+ tech skills courses.