Resolve-DnsName

Perform a DNS name query resolution for the specified name.

Syntax
      Resolve-DnsName
         [-Name] String [[-Type] RecordType]
            [-Server String[]] [-DnsOnly] [-CacheOnly] [-DnssecOk] [-DnssecCd] [-NoHostsFile]
               [-LlmnrNetbiosOnly] [-LlmnrFallback] [-LlmnrOnly] [-NetbiosFallback] [-NoIdn]
                  [-NoRecursion] [-QuickTimeout] [-TcpOnly] [CommonParameters]

Key
   -CacheOnly
      Resolve this query using only the local cache.
      
   -DnsOnly
      Resolve this query using only the DNS protocol.

   -DnssecCd
      Set the DNSSEC checking-disabled bit for this query.

   -DnssecOk
      Set the DNSSEC OK bit for this query.   

   -LlmnrFallback
      Allow falling back to the LLMNR protocol when resolving this query with DNS fails.

   -LlmnrNetbiosOnly
      Resolve this query using only the LLMNR or NetBIOS protocols.

   -LlmnrOnly
      Resolve this query using only the LLMNR protocol.

   -Name
      The name to be resolved.

   -NetbiosFallback
      Allow fallback to the NetBIOS protocol when resolving this query with DNS fails.

   -NoHostsFile
      Skip the hosts file when resolving this query.
      
   -NoIdn
      Do use IDN encoding logic for the query.

   -NoRecursion
      Instruct the server not to use recursion when resolving this query.

   -QuickTimeout
      Use shorter timeouts for this query.

   -Server
      Specifies the IP addresses or host names of the DNS servers to be queried.
      By default the interface DNS servers are queried if this parameter is not supplied.

   -TcpOnly
      Use only TCP for this query.

   -Type RecordType
      The DNS query type that is to be issued.
      By default the DNS record type is A_AAAA, the A and AAAA types will both be queried.
      
      The acceptable Record Types for this parameter are:
Record Type Value Description
A 1 IPv4 server Address.
A_AAAA 0 A_AAAA.
AAAA 28 IPv6 server address.
AFSDB 18 AFS database servers.
ALL 255 Wildcard match.
ANY 255 Wildcard match.
CNAME 5 Canonical name.
DHCID 49 Dynamic Host Configuration Protocol information.
DNAME 39 Domain aliases.
DNSKEY 48 DNS key record.
DS 43 Delegation signer.
HINFO 13 Host information.
ISDN 20 Integrated Services Digital Network.
MB 7 Mailbox domain name.
MD 3 Mail destination.
MF 4 Mail forwarder.
MG 8 Mail group member.
MINFO 14 Mailbox information.
MR 9 Mail rename name.
MX 15 Mail routing information.
NS 2 Name server.
NSEC 47 Next-secure record.
NSEC3 50 NSEC record version 3.
NSEC3PARAM 51 NSEC3 parameters.
NULL 10 Null resource record.
OPT 41 DNS option.
PTR 12 Domain name pointer.
RP 17 Responsible person.
RRSIG 46 DNSSEC signature.
RT 21 DNS route through.
SOA 6 Start of authority zone.
SRV 33 Server selection.
TXT 16 Text strings.
UNKNOWN 0 Unknown
WKS 11 Well known service.
X25 19 Packet switched Wide Area Network.

Resolve-DnsName performs a DNS query for the specified name.
This cmdlet is functionally similar to the nslookup tool which can also be used to query for names.

Standard Aliases for Resolve-DnsName: none

Examples

Resolve a name using the default options:

PS C:\> Resolve-DnsName -Name www.propublica.org

Resolve a name against the default DNS gateway server at 10.0.0.1:

PS C:\> Resolve-DnsName -Name www.propublica.org -Server 10.0.0.1

Resolve a name against the Google DNS gateway server at 8.8.8.8:

PS C:\> Resolve-DnsName -Name www.propublica.org -Server 8.8.8.8

Query for A type records for name www.propublica.org:

PS C:\> Resolve-DnsName -Name www.propublica.org -Type A

Resolve a name using only DNS. LLMNR and NetBIOS queries are not issued:

PS C:\> Resolve-DnsName -Name www.propublica.org -DnsOnly

“I shall seek truth, understand truth, and accept truth. This should be the firm resolve of a historian” ~ Jadunath Sarkar

Related PowerShell Cmdlets

Get-DnsClientServerAddress - Get a DNS server’s IP addresses from the TCP/IP properties on an interface.
CMD equivalent: NSLOOKUP - Name server lookup.


 
Copyright © 1999-2026 SS64.com
Some rights reserved