From b5ba42cfc734cad9ec48cc94f43125f071edfd6b Mon Sep 17 00:00:00 2001 From: Winston Smith Date: Wed, 2 Jun 2021 16:06:14 +0200 Subject: [PATCH] Fix: Zone Transfer + Reverse. Need test --- Guests/SRV-01.ps1 | 5 ++++- Guests/SRV-03.ps1 | 7 +++++++ Todo_Next | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Guests/SRV-01.ps1 b/Guests/SRV-01.ps1 index 7812f9e..8f77e36 100644 --- a/Guests/SRV-01.ps1 +++ b/Guests/SRV-01.ps1 @@ -151,10 +151,11 @@ Set-DnsServerResourceRecord -ZoneName asrc.local -NewInputObject $soanew -OldInp #Set zone transfer -Set-DnsServerPrimaryZone -ComputerName SRV-01 -Name asrc.local -SecureSecondaries "TransferToZoneNameServer" -SecondaryServers "192.168.128.1" +Set-DnsServerPrimaryZone -ComputerName SRV-01 -Name asrc.local -SecureSecondaries "TransferToZoneNameServer" #Create reverse lookup Zone Add-DnsServerPrimaryZone -NetworkID "192.168.0.0/16" -Zonefile "168.192.in-addr.arpa.dns" +Set-DnsServerPrimaryZone -Name 168.192.in-addr.arpa -SecureSecondaries "TransferToZoneNameServer" ###TO BE FIXED #Rename SOA+NS Reverse $ns = Get-DnsServerResourceRecord -ZoneName 168.192.in-addr.arpa -RRType NS @@ -187,8 +188,10 @@ Add-DnsServerResourceRecordA -Name "srv-01" -ZoneName "asrc.local" -IPv4Address Add-DnsServerResourceRecordA -Name "srv-02" -ZoneName "asrc.local" -IPv4Address "192.168.8.2" -TimeToLive 01:00:00 -CreatePTR Add-DnsServerResourceRecordA -Name "srv-03" -ZoneName "asrc.local" -IPv4Address "192.168.128.1" -TimeToLive 01:00:00 -CreatePTR Add-DnsServerResourceRecord -ZoneName "asrc.local" -NS -Name asrc.local -Nameserver "srv-03.asrc.local." +Add-DnsServerResourceRecord -ZoneName "168.192.in-addr.arpa" -NS -Name 168.192.in-addr.arpa -Nameserver "srv-03.asrc.local." ## UNSURE #Add-DnsServerResourceRecord -ZoneName "asrc.local" -A -Name dev.asrc.local -IPv4Address "192.168.128.1" Add-DnsServerZoneTransferPolicy -Name "asrc.local" -Action IGNORE -ServerInterfaceIP "ne,192.168.128.1" -PassThru -ZoneName "asrc.local" +Add-DnsServerZoneTransferPolicy -Name "168.192.in-addr.arpa" -Action IGNORE -ServerInterfaceIP "ne,192.168.128.1" -PassThru -ZoneName "168.192.in-addr.arpa" #Add-DnsServerZoneDelegation -Name "asrc.local" -ChildZoneName "dev" -NameServer "srv-03.asrc.local." -IPAddress 192.168.128.1 -PassThru -Verbose diff --git a/Guests/SRV-03.ps1 b/Guests/SRV-03.ps1 index 73c971c..f9c480c 100644 --- a/Guests/SRV-03.ps1 +++ b/Guests/SRV-03.ps1 @@ -105,6 +105,13 @@ Add-DnsServerPrimaryZone -ResponsiblePerson "bol@loc.ks" -DynamicUpdate None -Zo Set-DnsServerPrimaryZone -ComputerName SRV-03 -Name dev.asrc.local -SecureSecondaries "NoTransfer" +#Create reverse lookup Zone + +Add-DnsServerPrimaryZone -NetworkID "192.168.0.0/16" -Zonefile "168.192.in-addr.arpa.dns" +Add-DnsServerSecondaryZone -NetworkID "192.168.0.0/16" -Zonefile "168.192.in-addr.arpa.dns" -MasterServers 192.168.8.1 + +#Rename SOA+NS Direct + $ns = Get-DnsServerResourceRecord -ZoneName dev.asrc.local -RRType NS $nsnew = $ns.Clone() diff --git a/Todo_Next b/Todo_Next index 4b3ffdd..0308b0f 100644 --- a/Todo_Next +++ b/Todo_Next @@ -1,2 +1,4 @@ SRV-01 reverse lookup Add SRV-03 as NS in reverse lookup +Add Reverse lookup on SRV-03 +Fix reverse lookup zone transfer from SRV-01