Home » PowerShell » The new nslookup: Resolve-DnsName

The new nslookup: Resolve-DnsName

Nslookup is a command-line tool for dns name resolution. Resolve-DnsName is the modern version of nslookup. In this blog post i will show how to use Resolve-DnsName to query DNS Host Names and much more.

Standard Query

To do a Standard Query simply run the command and specify the host name. Format-Table is not necessary, but helpful.

Resolve-DnsName | Format-Table -AutoSize


Query without Host File

Remember: Your host will first query the host file and the DNS Client Cache. If and only if the host file and the cache returns no result, the DNS Server is contacted. To avoid this, run Resolve-DnsName with the -NoHostFile Parameter.

Resolve-DnsName -NoHostsFile

Query in Cache-Only Mode

To demontrate this, i clear the Dns Client Cache and then i try to query This must lead to an error. Bingo!

Resolve-DnsName -CacheOnly


Specify a DNS-Server

Resolve-DnsName without any parameter will contact your primary DNS-Server, which is configured in the settings of your network card. The parameter -Server allows you to specify other DNS-Servers.

Resolve-DnsName -Server | Format-List


Query for Records

Use the Type Parameter to query for specific records.

MX Records (Mail-Server)

Resolve-DnsName -Type MX


AAAA Records (IPv6 only)

Resolve-DnsName -Type AAAA | Format-List


Wait a minute. Did you notice it? No? Read the IPv6 Address of facebook again. 😉 They have left nothing to chance.


To use only Link Local Multicast Name Resoultion use the LlmnrOnly Parameter. LLMNR will only work with computers which share the same local link.

Dc01 and my computer share the same link. It works.

Resolve-DnsName dc01 -LlmnrOnly | Format-Table -AutoSize

Unbenannt.PNG is not on the same link. Which leads to an error.



Related Links

For checking network and domain connectivity see my articles The modern version of ping: Test-Connection and Checking connectivity to Active Directory: Test-ComputerSecureChannel.


  1. […] checking name resoultion and network connectivity see also: The new nslookup: Resolve-DnsName and The modern version of ping: […]


  2. […] The new nslookup: Resolve-DnsName […]


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Who is the blogger?

My name is Patrick Grünauer (pewa2303). I am from Austria. On sid-500 I write about Windows, Cisco and IT-Security in English and German. Have fun while reading!

Patrick Gruenauer
Follow SID-500 on