Configuring Azure DNS delegation using PowerShell

If you want to configure the delegation with a third-party domain registrar, you will not be able to do the whole process using PowerShell, because PowerShell is not a supported API for this. However, you will need to retrieve the name servers of the Azure DNS zone, and you can do so by running the following cmdlets:

$GamezZone = Get-AzureRmDnsZone -Name Gamezakhana.com -ResourceGroupName PacktPub

$GamezZoneRecords = Get-AzureRmDnsRecordSet -Name "@" -RecordType NS -Zone $GamezZone

In case you want to delegate a subdomain, you have to create the child DNS zone first, as you have learned earlier, then you need to retrieve its DNS records and store it in a variable, as discussed in the previous cmdlets, and then finally run the following cmdlets:

$DelegateNSRecordSet = New-AzureRmDnsRecordSet -Zone $GamezZone -Name Child -RecordType NS -Ttl 3600

$DelegateNSRecordSet.Records = $ChildZoneRecords.Records
Set-AzureRmDnsRecordSet -RecordSet $DelegateNSRecordSet

Where $ChildZoneRecords is the variable that you should create to store the child DNS zone NS records.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset