Category Archives: DNS

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 | Leave a 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