Aug 082011

A while ago I created a simple script to create some DNS records using dnscmd.exe. This because there where no DNS cmdlets for PowerShell available. Although it worked fine for me, I can imagine people would rather using PowerShell cmdlets.

Nowadays they are available for download yet pretty hard to find. I haven’t used them myself yet, but check it out yourself 🙂

As per version 0.4.4 the following cmdlets are available:

DNS Resolver

  • Get-Dns

WMI Wrappers

  • Clear-DnsCache
  • Get-DnsRecord
  • Get-DnsServer
  • Get-DnsZone
  • New-DnsRecord
  • New-DnsZone
  • Remove-DnsObject
  • Reset-DnsZoneType (no Get-Help)
  • Resume-DnsZone
  • Set-DnsRecord (no Get-Help)
  • Set-DnsServer (to be completed)
  • Set-DnsZone (to be completed)
  • Set-DnsZoneTransfer (no Get-Help)
  • Start-DnsScavenging
  • Start-DnsService
  • Stop-DnsService
  • Suspend-DnsZone
  • Update-DnsZone
  • Update-DnsZoneFile

Active Directory

  • Get-ADDnsPartition
  • Get-ADDnsRecord
  • Get-ADDnsZone
  • New-ADDnsRecord (to be completed)
  • New-ADDnsZone (to be completed)
  • Remove-ADDnsRecord (to be completed)
  • Remove-ADDnsZone (to be completed)
  • Set-ADDnsRecord (to be completed)
  • Set-ADDnsZone (to be completed)
May 032010

Since I’m currently busy with installing multiple ESX servers in our test environment, I needed to create about 32 DNS records. Well since I’m lazy and I’ve really been loving Powershell I thought it would be a nice challenge to use PowerShell and of course the powerful DNScmd command. Since we have a logical IP plan, I could use the following script.

1..32 | % {iex ([string]::format(“dnscmd /RecordAdd ESXhost{0} /createPTR A 192.168.10.{0}”,$_))}

Of course there are many other ways. For example, using a CSV file to import the DNS records.

For example:

Import-CSV c:\DNS.csv | foreach {dnscmd /RecordAdd $_.Zone $_.hostname /createPTR A $_.IPaddress}

However, keep in mind that PowerShell uses comma separated files and not the semicolon separated file which Excel automatically creates. So for example, use:


Instead of:


Feb 022010

Due to security reasons WPAD and ISATAP have been by default blocked in Windows server 2008 DNS. There is a GlobalQueryBlockList which blocks these entries. When you try to create a WPAD entry to configure your ISA Auto Discovery, it will fail to resolve the WPAD entry whereas it will resolve the WSPAD entry. This can be quite problematic when you using the WPAD DNS entry rather then the DHCP possibility.

To remove the WPAD from the block list type the following command:
Dnscmd /config /globalqueryblocklistisatap

This command will override the existing list with ISATAP as the only keyword.
Now, you can resolve the WPAD entry from NSLOOKUP

Check DNS Server Global Query Block List from the Microsoft website for more details about DNS