Category Archives: DNS

Get-DnsServerResourceRecord

You saw how to discover the zones on a DNS server in the first post in this series. Now its time to discover the records in a zone. For that you need Get-DnsServerResourceRecord. The syntax is: Get-DnsServerResourceRecord [-ZoneName] <string> [[-Name] … Continue reading

Posted in DNS, PowerShell v6 | Leave a comment

DNS zones

I’m working through the commonly used DNS server cmdlets to determine if everything works in PowerShell core. First up is the cmdlet to get the DNS zones on your DNS server. PS>  Get-DnsServerZone | Format-List -Property ZoneName, ZoneType,  IsAutoCreated, IsDsIntegrated, … Continue reading

Posted in DNS, PowerShell v6 | Leave a comment

Test DNS servers

Had a recent comment about testing DNS servers which got me thinking how do I test DNS servers. I decided I wanted to get the DNS server address from the client, ping the DNS server to test network connectivity and … Continue reading

Posted in DNS | Leave a comment

Finding DNS static records

An interesting question from the forums about finding DNS static records You can view the records in a DNS zone Get-CimInstance -Namespace root\MicrosoftDNS -ClassName MicrosoftDNs_Atype -ComputerName W16DC01  -Filter “DomainName = ‘manticore.org’” | select OwnerName, Timestamp, IPAddress but how do you … Continue reading

Posted in DNS, Powershell, PowerShell and CIM | Leave a comment

Creating DNS records

Following on from my previous post about creating a reverse lookup zone in DNS here’s a function to create records in that zone. The function takes an IP address and name (of host) and uses Add-DnsServerResourceRecordA  to add the record … Continue reading

Posted in DNS, Powershell, Windows Server 2012 R2 | 1 Comment

Create a reverse lookup zone

I needed to create a DNS reverse lookup zone for my test environment. With Windows Server 2012 R2 I’ve got cmdlets available for managing DNS servers – the DnsServer module. You need to install the DNS role or the DNS … Continue reading

Posted in DNS, Powershell, Windows Server 2012 R2 | Leave a comment

NSlookup in PowerShell

nslookup.exe is a command line executable that is used to discover the IP address of a remote machine from its FQDN. The results look something like this: PS> nslookup powershell.orgDNS request timed out.    timeout was 2 seconds.Server:  UnKnownAddress:  192.168.0.1 Non-authoritative … Continue reading

Posted in DNS, Powershell | Leave a comment

Error handling for DNS lookups

Interesting question on the forum regarding the Resolve-DNSname cmdlet. This is part of the DNSclient module introduced with Windows 8. If the DNS record is found everything is good £> Resolve-DnsName W12R2DSC -Server server02 | ft -a Name                   Type TTL  … Continue reading

Posted in DNS, PowerShell v5, Windows Server 2012 R2 | 1 Comment

Parsing ipconfig /displaydns with regular expressions

In yesterdays post I used a series of split operations to parse the strings produced by ipconfig /displaydns Regular expressions should give a more power full way to perform this task. Not being a big fan of regular expressions I … Continue reading

Posted in DNS, Networking, Powershell | Leave a comment

Parsing ipconfig /displaydns

  A recent question on the forum asked how you could get the contents on Windows 7 machines and earlier. On later machines – Windows 8 and above –  its easy because you can use Get-DnsClientCache from the DnsClient module. … Continue reading

Posted in DNS, Networking, PowerShellGet | 1 Comment