Я изменяю приведенную ниже версию Powershell, чтобы добавить запись DNS-сервера из списка доменов и настроить SOA TTL за 15 минут.
Пока я не могу понять, как:
- Установите для SOA TTL всего 15 минут.
- Установите для номера SOA значение ГГГГММДД01
$DomainNames = 'FinanceProduct1.com'
$PrimaryDNSServer = 'PRDSVRDNS01-VM'
$SecondaryDNSServer1 = 'PRDSVRDNS02-VM'
$SecondaryDNSServer2 = 'PRDSVRDNS03-VM'
#Create Primary DNS Forward Lookup Zone
Add-DnsServerPrimaryZone -ComputerName $PrimaryDNSServer -Name $DomainNames -ZoneFile $DomainNames.dns -DynamicUpdate None -ResponsiblePerson "domains.$($ENV:USERDNSDOMAIN.ToLower())"
Set-DnsServerPrimaryZone -ComputerName $PrimaryDNSServer -Name $DomainNames -SecureSecondaries "TransferToSecureServers" -SecondaryServers "$([System.Net.Dns]::GetHostAddresses($SecondaryDNSServer1).IPAddressToString)", "$([System.Net.Dns]::GetHostAddresses($SecondaryDNSServer2).IPAddressToString)"
# Set the Public DNS servers to replicate to
Add-DnsServerResourceRecord -ComputerName $PrimaryDNSServer -Name '@' -ZoneName $DomainNames -NS -NameServer "ns1.$ENV:USERDNSDOMAIN"
Add-DnsServerResourceRecord -ComputerName $PrimaryDNSServer -Name '@' -ZoneName $DomainNames -NS -NameServer "ns2.$ENV:USERDNSDOMAIN"
Add-DnsServerResourceRecord -ComputerName $PrimaryDNSServer -Name '@' -ZoneName $DomainNames -NS -NameServer "ns3.$ENV:USERDNSDOMAIN"
#Let the Forward lookup zones created completely
Start-Sleep -Seconds 5
#Replicate the Forwardlookup zones into two additional Public DNS servers
Add-DnsServerSecondaryZone -ComputerName $SecondaryDNSServer1 -MasterServers [System.Net.Dns]::GetHostAddresses($PrimaryDNSServer).IPAddressToString -Name $DomainNames -ZoneFile "$DomainNames.dns"
Add-DnsServerSecondaryZone -ComputerName $SecondaryDNSServer2 -MasterServers [System.Net.Dns]::GetHostAddresses($PrimaryDNSServer).IPAddressToString -Name $DomainNames -ZoneFile "$DomainNames.dns"
Я также не уверен, что @Splatting даже работает вышеуказанный запрос.