Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to inspect TXT records for my domain, such as SPF records. I tried the following command with nslookup but it didn't list the TXT records:

nslookup -type=TXT

What is the correct command, or is there a better tool use on Windows 7?

share|improve this question
The command above works but has no TXT records however does. – Iain Aug 24 '10 at 20:38
Please see answer by WilfriedVS, which works as a charm – lucaferrario Apr 29 '15 at 8:49
up vote 27 down vote accepted

First start nslookup without parameters, then type set type=txt, then type the domain name.

nslookup <enter>
set type=txt <enter>



Default Server:  mydnsserver

> set type=txt


Server:  mydnsserver


*** No text (TXT) records available for

share|improve this answer
This is the real answer to the question and should be marked as such! – lucaferrario Apr 29 '15 at 8:48
Updated to use this as the answer. – Josh May 26 at 17:33

I have no ideea why but if you add an IP of a nameser at the end it will work.
I have added google's dns name in this case:

nslookup -type=TXT

It can be your local DNS service.

HTH next time when you need to query your TXT records.

share|improve this answer
The last parameter is the DNS to use. Maybe the default is to use the ISPs and that DNS is caching old data. This might work soon after a DNS TXT record change. – tgkprog Apr 4 at 19:01
If you type : nslookup /? will see : nslookup [-opt ...] host server # just look up 'host' using 'server' – tgkprog Apr 4 at 19:01

Download BIND for Windows, there is a Windows port of dig in that. You should use dig instead of nslookup.

If you're a Powershell fan (like me) you can also download the Powershell Dig Cmdlet which should get TXT records for you directly within powershell. Good stuff.

PS> Get-Dns -Name -Type TXT
share|improve this answer

The link for Get-Dns does not work, the standard Powershell cmdlet to do this is

PS> Resolve-DnsName -Type TXT

See more on Resolve-DnsName

share|improve this answer
That only works on Windows Server 2012 R2 and Windows 8.1, question was about Windows 7 – LJT May 26 at 5:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.