PowerShell for Windows Admins:

DNS


November 21, 2019  3:17 PM

Get-DnsServerResourceRecord

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
DNS, Powershell

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] <string>] [-Type]...

November 20, 2019  1:48 PM

DNS zones

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
DNS, Powershell

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, IsReverseLookupZone,...


June 22, 2019  5:29 AM

Test DNS servers

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
DNS, Powershell

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 test if DNS was up and working. The current result is this: function...


January 29, 2017  9:50 AM

Finding DNS static records

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, DNS, Powershell

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,...


October 30, 2015  11:37 AM

Creating DNS records

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
DNS, Powershell

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 to the forward lookup zone – I use my default AD...


October 30, 2015  11:36 AM

Create a reverse lookup zone

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
DNS, Powershell

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 RSAT tools to get access to the module. To create a new reverse lookup...


October 13, 2015  10:38 AM

NSlookup in PowerShell

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
DNS, 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.org DNS request timed out. timeout was 2 seconds. Server:  UnKnown Address: ...


September 29, 2015  5:32 AM

Error handling for DNS lookups

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
DNS, Powershell

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 0 Comments     RSS Feed     Email a friend


June 29, 2015  9:12 AM

Parsing ipconfig /displaydns with regular expressions

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
DNS, Powershell

In yesterday's 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 tend not to use them but for the sake of experimentation I...


June 28, 2015  1:53 PM

Parsing ipconfig /displaydns

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
DNS, Powershell

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. This module is based on CIM classes that aren’t present on Windows 7...


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: