Command Reference

Resolve-DnsName

PowerShell Networking Intermediate Risk: Low
Back to Command Library

Summary

Queries DNS and displays the records returned for a hostname or domain.

Syntax

Resolve-DnsName <Name> [-Type <RecordType>] [-Server <IPAddress>]

Examples

Resolve-DnsName www.microsoft.com

Queries the configured DNS service for the host's records.

Permissions

Administrator required: No

DNS queries normally do not require elevation.

Risk and Impact

Risk level: Low

Changes the system: No

This command reads DNS data and does not change resolver settings.

Supported Platforms

Windows 10 Windows 11 Windows Server

Important Output Fields

Name

Record name returned by DNS.

Type

DNS record type such as A, AAAA, or CNAME.

IPAddress

Address returned for an address record.

Common Errors

DNS name does not exist

The resolver returned NXDOMAIN or the name was entered incorrectly.

DNS server failure

The DNS server could not complete the request.

Official References

Resolve-DnsName

Microsoft Learn · Official Documentation

Open Source