CMD: Determine the Mail Server for Any Domain

Contributor Icon Contributed by davak Date Icon September 19, 2004  
Tag Icon Tagged: Windows

Quick little way to find the mail server for any known domain.


People are often curious what the mail server is for a given domain. Here’s a quick way to find out…

    1. Click Start
    2. Click Run
    3. Type cmd in the textbox and hit enter
    4. In the command line type nslookup
    5. Enter set type = mx
    6. Enter the name of the domain you want to look up
    7. When you are done type exit

Here’s an example looking up Microsoft’s mail server. You can see that microsoft’s mail servers are named maila, mailb, and mailc.

C:\Documents and Settings\Tech-Recipes>nslookup
*** Can't find server name for address 192.168.0.1: Non-existent domain
*** Default servers are not available
Default Server: UnKnown
Address: 192.168.0.1

> set type=mx
> microsoft.com
Server: UnKnown
Address: 192.168.0.1

Non-authoritative answer:
microsoft.com MX preference = 10, mail exchanger = maila.microsoft.com
microsoft.com MX preference = 10, mail exchanger = mailb.microsoft.com
microsoft.com MX preference = 10, mail exchanger = mailc.microsoft.com
>

Previous recipe | Next recipe |
 
  • qmchenry
    This is a great technique for getting the mail exchanger(s) for a domain. Most UNIX flavors also have nslookup, so this will work there, too. The dig command, where available, can be used to do this, too (dig mx domain.com).

    It's important to note that the mail exchanger for a domain may not be the same as the domain's mail server. These days, most organizations use mail relayers of one sort or another to block spam, check for viruses, add redundancy, and take processing load off their mail server.
  • davak
    <ul id="quote"><h6>qmchenry wrote:</h6>This is a great technique for getting the mail exchanger(s) for a domain. Most UNIX flavors also have nslookup, so this will work there, too. The dig command, where available, can be used to do this, too (dig mx domain.com).

    It's important to note that the mail exchanger for a domain may not be the same as the domain's mail server. These days, most organizations use mail relayers of one sort or another to block spam, check for viruses, add redundancy, and take processing load off their mail server.</ul>

    Hey, I know you are a unix/solaris guru... but now you are showing me up in the windows section too!

    (/me slaps qmchenry with a dead smelly fish)

    :D
  • qmchenry
    Oh, no.. I'd just gotten the dead smelly fish smell off my face from the last time..
blog comments powered by Disqus