PowerShellRay

Azure DNS using PowerShell

Posted on: October 5, 2015

write-Verbose "Change in Resource Manager cmdlets"
Switch-AzureMode -Name AzureResourceManager
write-Verbose "give you permission on Azure subscription"
Add-AzureAccount
write-Verbose "Select Azure subscription"
Select-AzureSubscription -SubscriptionName "Visual Studio Ultimate with MSDN"
write-Verbose "Create Resource Group"
New-AzureResourceGroup -Name PublicDNS -location "North Europe"
write-Verbose "Regester Azure provider for Microsoft Network"
Register-AzureProvider -ProviderNamespace Microsoft.Network
write-Verbose "Create Azure DNS Zone"
New-AzureDnsZone -Name powershellrayco.com -ResourceGroupName PublicDNS

write-Verbose "Get DNS records in the DNS Zone"
Get-AzureDnsRecordSet -ZoneName powershellrayco.com -ResourceGroupName PublicDNS

 

# For the below command
PS C:\WINDOWS\system32> Get-AzureDnsRecordSet -ZoneName powershellrayco.com -ResourceGroupName PublicDNS

 

<#Output will be like what shown below

Name              : @

ZoneName          : powershellrayco.com

ResourceGroupName : PublicDNS

Ttl               : 3600

Etag              : 6bcfa6dc-fb2b-4a77-8c6a-70fa6f0a4d00

RecordType        : SOA

Records           : {[ns1-03.azure-dns.com,msnhst.microsoft.com,3600,300,2419200,300]}

Tags              : {}

Name              : @

ZoneName          : powershellrayco.com

ResourceGroupName : PublicDNS

Ttl               : 3600

Etag              : 14006a73-f681-4e30-9a71-cb4eec2f9256

RecordType        : NS

Records           : {ns1-03.azure-dns.com, ns2-03.azure-dns.net, ns3-03.azure-dns.org, ns4-03.azure-dns.info}

Tags              : {}

 

Below are all cmdlets used for Azure DNS administration

CommandType     Name                                               Version    Source                                                                                                
———–     —-                                               ——-    ——                                                                                                
Cmdlet          Add-AzureDnsRecordConfig                          0.9.8      AzureResourceManager                                                                                  
Cmdlet          Get-AzureDnsRecordSet                                  0.9.8      AzureResourceManager                                                                                  
Cmdlet          Get-AzureDnsZone                                             0.9.8      AzureResourceManager                                                                                  
Cmdlet          New-AzureDnsRecordSet                                0.9.8      AzureResourceManager                                                                                  
Cmdlet          New-AzureDnsZone                                           0.9.8      AzureResourceManager                                                                                  
Cmdlet          Remove-AzureDnsRecordConfig                  0.9.8      AzureResourceManager                                                                                  
Cmdlet          Remove-AzureDnsRecordSet                         0.9.8      AzureResourceManager                                                                                  
Cmdlet          Remove-AzureDnsZone                                    0.9.8      AzureResourceManager                                                                                  
Cmdlet          Set-AzureDnsRecordSet                                    0.9.8      AzureResourceManager                                                                                  
Cmdlet          Set-AzureDnsZone                                               0.9.8      AzureResourceManager                                                                                  
Cmdlet          Test-AzureDnsAvailability                                0.9.8      AzureResourceManager#>                                                                             

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: