DNS cmdlets in PowerShell 3

There are a number of modules related to DNS

ModuleType Name
---------- ----
Manifest   DnsClient
Manifest   DnsConfig
Binary     DnsLookup
Manifest   DnsNrpt

If we start with the DnsClient module we get these functions and cmdlets

Add-DnsClientNrptRule
Clear-DNSClientCache
Get-DNSClient
Get-DNSClientCache
Get-DnsClientEffectiveNrptPolicy
Get-DnsClientNrptGlobal
Get-DnsClientNrptRule
Get-DNSGlobalSettings
Get-DNSServerAddress
Remove-DnsClientNrptRule
Set-DNSClient
Set-DnsClientNrptGlobal
Set-DnsClientNrptRule
Set-DNSGlobalSettings
Resolve-DnsName

Knowing which DNS server the client is using

PS> Get-DNSServerAddress | select ElementName, Name

ElementName                                                 Name
-----------                                                 ----
Virtual Wireless                                            192.168.2.1
isatap.{E962BF88-1194-44A8-B30B-A65A4772C812}               192.168.2.1
Virtual LAN                                                 10.10.54.201
isatap.{EA0AB201-1381-4643-A67D-72C9C8860860}               10.10.54.201
Loopback Pseudo-Interface 1                                 fec0:0:0:ffff::1
Loopback Pseudo-Interface 1                                 fec0:0:0:ffff::2
Loopback Pseudo-Interface 1                                 fec0:0:0:ffff::3

and what the client has cached

Get-DNSClientCache | select Name, data

Name                                                        data
----                                                        ----
server02                                                    192.168.2.1
server02                                                    10.10.54.201
server02                                                    192.168.1.6
server02.manticore.org                                      192.168.2.1
server02.manticore.org                                      10.10.54.201
server02.manticore.org                                      192.168.1.6
watson.telemetry.microsoft.com

final one for the moment – is a replacement for nslookup

PS> Resolve-DnsName exch07


IP4Address   : 10.10.54.130
Name         : exch07.Manticore.org
Type         : A
CharacterSet : Unicode
Section      : Answer
DataLength   : 4
TTL          : 1200

Published Sun, Sep 18 2011 15:50 by RichardSiddaway

Comments

# re: DNS cmdlets in PowerShell 3

Hi Richard,

Great post, though it seems that these modules aren't present (at least in the CTP) in the desktop version. Unfortunate, really!

Wednesday, November 16, 2011 4:51 PM by Chris Brown

# re: DNS cmdlets in PowerShell 3

Chris

The DNS client cmdlets are in the Windows 8 preview rather than the PowerShell CTP

Saturday, November 19, 2011 4:27 AM by RichardSiddaway

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above: