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

3 Responses to DNS cmdlets in PowerShell 3

  • Chris Brown says:

    Hi Richard,

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

  • RichardSiddaway says:

    Chris

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

  • Francis Swipes says:

    Is it possible to have a user who is NOT Domain Admin use the Powershell module DNSServer? The user is a member of DNSAdmins. I have set up PS Remoting so that non-admin user may connect to DNS server and see the DNSServer cmdlets. But every cmdlet the user runs returns “Cannot connect to CIM Server. Access Denied”. Domain Admin can execute the cmdlets in the same scenario.

Leave a Reply