Fix: DNS SOA+NS rename

This commit is contained in:
Alexandre-Simao 2021-06-01 15:30:37 +02:00
parent de77d7d976
commit 7ce08077f8

View File

@ -126,13 +126,30 @@ Get-DhcpServerv4Scope | Set-DhcpServerv4OptionValue -DnsServer 192.168.128.1,192
Install-WindowsFeature -Name DNS -IncludeManagementTools -includeallsubfeature 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 #Add-DnsServerPrimaryZone -NetworkID 192.168.8.0/24 -ZoneFile “192.168.8.1.in-addr.arpa.dns” # Zone secondaire
Add-DnsServerPrimaryZone -Name "asrbd.local" -ZoneFile "asrbd.local.dns" -DynamicUpdate None
Set-DnsServerPrimaryZone -ComputerName SRV-01 -Name asrbd.local -SecureSecondaries "TransferToSecureServers" -SecondaryServers "192.168.128.1" Set-DnsServerPrimaryZone -ComputerName SRV-01 -Name asrbd.local -SecureSecondaries "TransferToSecureServers" -SecondaryServers "192.168.128.1"
#Set-DnsServerResourceRecord -NewInputObject srv-01.asrbd.local -OldInputObject srv-01. -ZoneName "asrbd.local" -RRType SOA Add-DnsServerPrimaryZone -ResponsiblePerson "bol@loc.ks" -DynamicUpdate None -ZoneFile asrbd.local.dns -Name asrbd.local
$old= Get-DnsServerResourceRecord -ZoneName $allzone.ZoneName -Name @ -RRType Soa
$new = $old.Clone() $ns = Get-DnsServerResourceRecord -ZoneName asrbd.local -RRType NS
$new.RecordData.Name
$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
$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-DnsServerPrimaryZone -ComputerName SRV-01 -Name asrbd.local -SecureSecondaries "TransferToSecureServers" -SecondaryServers "192.168.128.1"
Add-DnsServerForwarder -IPAddress 9.9.9.9 -PassThru # Forward Add-DnsServerForwarder -IPAddress 9.9.9.9 -PassThru # Forward