diff --git a/Guests/SRV-01.ps1 b/Guests/SRV-01.ps1 index 666dd8c..2dc4e51 100644 --- a/Guests/SRV-01.ps1 +++ b/Guests/SRV-01.ps1 @@ -125,20 +125,18 @@ Get-DhcpServerv4Scope | Set-DhcpServerv4OptionValue -DnsServer 192.168.128.1,192 Install-WindowsFeature -Name DNS -IncludeManagementTools -includeallsubfeature -#Add-DnsServerPrimaryZone -NetworkID 192.168.8.0/24 -ZoneFile “192.168.8.1.in-addr.arpa.dns” # Zone secondaire - +#Create asrbd.local zone Set-DnsServerPrimaryZone -ComputerName SRV-01 -Name asrbd.local -SecureSecondaries "TransferToSecureServers" -SecondaryServers "192.168.128.1" Add-DnsServerPrimaryZone -ResponsiblePerson "bol@loc.ks" -DynamicUpdate None -ZoneFile asrbd.local.dns -Name asrbd.local +#Rename SOA+NS Main Zone $ns = Get-DnsServerResourceRecord -ZoneName asrbd.local -RRType NS $nsnew = $ns.Clone() $nsnew.RecordData.NameServer = "srv-01.asrbd.local" -# Get-DnsServerZone -Name asrbd.local - Set-DnsServerResourceRecord -ZoneName asrbd.local -NewInputObject $nsnew -OldInputObject $ns $soa = Get-DnsServerResourceRecord -ZoneName asrbd.local -RRType Soa @@ -150,8 +148,32 @@ $soanew.RecordData.ExpireLimit = (New-TimeSpan -Days 4) Set-DnsServerResourceRecord -ZoneName asrbd.local -NewInputObject $soanew -OldInputObject $soa +#Set zone transfer + Set-DnsServerPrimaryZone -ComputerName SRV-01 -Name asrbd.local -SecureSecondaries "TransferToSecureServers" -SecondaryServers "192.168.128.1" +#Create reverse lookup Zone +Add-DnsServerPrimaryZone -NetworkID "192.168.0.0/24" -Zonefile "168.192.in-addr.arpa.dns" + +#Rename SOA+NS Reverse +$ns = Get-DnsServerResourceRecord -ZoneName 168.192.in-addr.arpa -RRType NS + +$nsnew = $ns.Clone() + +$nsnew.RecordData.NameServer = "srv-01.asrbd.local" + +Set-DnsServerResourceRecord -ZoneName 168.192.in-addr.arpa -NewInputObject $nsnew -OldInputObject $ns + +$soa = Get-DnsServerResourceRecord -ZoneName 168.192.in-addr.arpa -RRType Soa + +$soanew = $soa.Clone() + +$soanew.RecordData.PrimaryServer = "srv-01.asrbd.local" +$soanew.RecordData.ExpireLimit = (New-TimeSpan -Days 4) + +Set-DnsServerResourceRecord -ZoneName asrbd.local -NewInputObject $soanew -OldInputObject $soa + +#Set DNS forwarder Add-DnsServerForwarder -IPAddress 9.9.9.9 -PassThru # Forward Add-DnsServerResourceRecordA -Name "SRV-01" -ZoneName "asrbd.local" -IPv4Address "192.168.8.1" -TimeToLive 01:00:00 diff --git a/Todo_Next b/Todo_Next new file mode 100644 index 0000000..87353bc --- /dev/null +++ b/Todo_Next @@ -0,0 +1 @@ +SRV-01 reverse lookup