How To Check Exchange Autodiscover SRV Record Using Nslookup

Generally the Exchange external Autodiscover DNS entity is configured as a regular A record.  Sometimes a service record (SRV) is used instead.  Since I have the habit of forgetting the syntax of quickly querying for the SRV record, this is one of those shared bookmark posts!

Nslookup is the tool of choice here!  Its documentation can be found on TechNet.


There are two ways to run nslookup – interactive and noninteractive.  Noninteractive is good when you know that you only want to query a single piece of data.   Let’s take a peek at an example of each.  We will check for the _autodiscover SRV record in the domain.  The record points to a host called  The full format of this record is:

For more reading on SRV records, take a peek at this article.  And for Autodiscover in general please review this post


Nslookup – Noninteractive

Open a cmd prompt and run

nslookup -q=srv

You should see the below output.  Note that the svr hostname will be the Autodiscover target.

Using Nslookup In NonInteractive Mode To Query For Exchange Autodisocver SRV Record

In this example we launched Nslookup in noninteractive mode.  The query type is set to SRV and then we checked for the record.

Nslookup - Interactive

Open a cmd prompt and run:

  1. nslookup
  2. set q=srv

Using Nslookup In Interactive Mode To Query For Exchange Autodisocver SRV Record

In this example we launched Nslookup in interactive mode, so we can interact with it.  The query type is set to SRV and then we checked for the record.


Reference – Autodiscover Exchange SRV Record Configuration

For reference purposes, the steps to add an Autodiscover SRV record will be something like the below.  They are intended to be general so please follow any specific notes or items for the DNS registrar you are using!


In your DNS zone editor add a SRV record with the following information:

  • Service _autodiscover

  • Protocol _tcp

  • Name   Enter one of the following values:

    • Enter @ if your registered domain is your cloud-based domain. For example, if your registered domain is and your cloud-based domain is, enter @.

    • Enter the subdomain name if your cloud-based domain is a subdomain of your registered domain. For example, if your registered domain is, but your cloud-based domain is the subdomain, enter test.

  • Priority 10  (or as per your design)

  • Weight 10  (or as per your design)

  • Port 443

  • Target   (in the example above this was

  • TTL   Verify that an appropriate TTL is selected, 1 hour is a common default.  (If you are approaching a migration, this should be decremented to allow for quicker cutover)


In addition to the SRV record pointing us to the correct location, we also have to ensure that there is a valid certificate installed which is published to the Internet.  This could be something as simple as a NAT rule with the appropriate firewall rule for TCP 443 or it could involve TMG or a load balancer's APM. 

The choice as they say - is yours!!



Comments (12)
  1. Nice, one line and all I have to remember is -q=srv, thanks!

  2. anonymouscommenter says:


  3. Sometimes its good to know what you are doing, I have ran interactive and non-interactive queries depending on whether I wanted to lookup just 1 record or multiple ones. now I know they have a name for it

  4. anonymouscommenter says:

    In the Exchange 2003 world and below, those administrators looking to automate and control the behaviour

  5. anonymouscommenter says:

    Being able to retrieve DNS TXT records is very useful in multiple scenarios. In this post we will look

  6. anonymouscommenter says:

    This article is tagged O365 but the instructions for creating the DNS SRV record do not seem to be compatible or applicable to O365.

    I just ran the provided nslookup command substituting my domain name and it was unable to resolve. I ran Outlook autodiscover test from the same PC, and SRV lookup succeeded. I would love to have something like this to test against when autodiscover to O365
    fails, but it seems the test does not apply either.

  7. It will work for O365 Michael – the domain you see above is one of my test tenants.

    What DNS server did you target ?


  8. anonymouscommenter says:

    The year 2015 is almost done, and 2016 is upon us! As in previous years , I thought it would be interesting

  9. anonymouscommenter says:

    I think the right query is like this:

    set type=srv

    SET TYPE= not SET Q=

    Am I right?

  10. You can use either Fernando,

    From the help content:

    type=X – set query type (ex. A,AAAA,A+AAAA,ANY,CNAME,MX,NS,PTR,SOA,SRV)
    querytype=X – same as type


    1. Imtiaz says:

      recently migrated the exchange but i don’t find the autodiscover xml file. how to publish the autodiscover file. And is it necessary to publish the autodiscovery file?

      1. Yes – I do expect Autodisocver to be correctly published. Follow the steps in the Exchange Deployment Assistant, and then verify with the remote connectivity analyser


Comments are closed.

Skip to main content