End of 01/06

This commit is contained in:
Alexandre-Simao 2021-06-02 09:44:32 +02:00
parent b750542223
commit dd0d388334
2 changed files with 27 additions and 4 deletions

View File

@ -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

1
Todo_Next Normal file
View File

@ -0,0 +1 @@
SRV-01 reverse lookup