Powershell - Testing name resolution (equivalent to nslookup)

To support me, you can subscribe to the channel, share and like the videos, disable your ad blocker or make a donation. Thank you!

Hello,

After the commands for displaying and modifying the DNS configuration of network interfaces, here is a set of Powershell commands for performing name resolution tests

# Test name resolution (equivalent to nslookup)
Resolve-Dnsname -Name google.com
# Display resource records (in the example, NS: name server)
Resolve-Dnsname -Name google.com -Type NS
# Get the result for several names
"google.com", "google.fr" | Resolve-DnsName -Type A
# Perform a reverse DNS query
Resolve-Dnsname -Name 172.217.20.195
# Obtain the result from a specific DNS server
Resolve-Dnsname -Name google.com -Type A -Server 1.1.1.1
# Obtain the result from a DNS server only
Resolve-DnsName -Name www.google.com -DnsOnly
# Get the result from the cache only
Resolve-DnsName -Name www.google.com -CacheOnly
# Get the result using DNSSec
Resolve-DnsName -Name www.google.com -DnssecOk
# Get the result without using DNSSec
Resolve-DnsName -Name www.google.com -DnssecCd
# Obtain the result without using the hosts file
Resolve-DnsName -Name www.google.com -NoHostsFile
# If DNS fails, try using Netbios
Resolve-DnsName -Name srv-1 -NetbiosFallback
# If DNS fails, try using LLMNR
Resolve-DnsName -Name srv-1 -LlmnrFallback
# Obtain the result with LLMNR and Netbios
Resolve-DnsName -Name srv-1 -LlmnrNetbiosOnly
# Obtain the result with LLMNR only
Resolve-DnsName -Name srv-1 -LlmnrOnly
# Ask the DNS server not to use recursive queries
Resolve-DnsName -Name www.google.com -NoRecursion
# Reduce the timeout duration
Resolve-DnsName -Name google.com -QuickTimeout
# Obtain the result using TCP only
Resolve-DnsName -Name www.google.com -TcpOnly
# There are 3 parameters not documented in the help on my Windows 11 24h2 but I haven't found any information about them
# -CheckCache
# -DohServer
# -DotServer

Related links