Dig with PowerShell using Resolve-DnsName

Image Description

Daily PowerShell #21

Scripting Daily PowerShell

November 6, 2021

quote Discuss this Article

Resolve-DnsName is similar to dig within BIND.

This command has been around since PowerShell v3. This post will look at comparisons between dig commands and Resolve-DnsName.

Resolve A Records

Resolve IPv4 records for the host name.

dig ironmansoftware.com A

Resolve-DnsName -Name ironmansoftware.com -Type A

Resolve AAAA Records

Resolve IPv6 records for the host.

dig ironmansoftware.com AAAA

Resolve-DnsName -Name ironmansoftware.com -Type AAAA

Resolve MX Records

Resolve MX records for the host.

dig mx ironmansoftware.com

Resolve-DnsName -Name ironmansoftware.com -Type MX

Custom Name Server

Resolve the host name using a custom name server.

dig A ironmansoftware.com @8.8.8.8

Resolve-DnsName -Name ironmansoftware.com -Type A -Server 8.8.8.8