Skip to content

Instantly share code, notes, and snippets.

View Zoran-Jankov's full-sized avatar
🎯
Focusing on PowerShell

Zoran Jankov Zoran-Jankov

🎯
Focusing on PowerShell
View GitHub Profile
@msoler8785
msoler8785 / Create-PtrRecords.ps1
Last active July 4, 2024 00:57
Quick PowerShell script to automate PTR Record creation for existing forward lookup zones.
# Creates PTR Records for all A Records in the specified -ZoneName.
# Uses a Class A Subnet for the reverse zone.
$computerName = 'dns-server01';
# Get all the DNS A Records.
$records = Get-DnsServerResourceRecord -ZoneName 'zone.example.com' -RRType A -ComputerName $computerName;
foreach ($record in $records)
{
# The reverse lookup domain name. This is the PTR Response.
$ptrDomain = $record.HostName + '.zone.example.com';