If you are frequently creating DNS records, it is much easier to set up az cli to do it without having to log into the Azure Web portal.
-
Install az cli from here
-
Log in to az cli with
az login
-
Set table output as default (optional, qol)
az configure --defaults output=table
- List and set your subscription
az account list
az account set --subscription [SUBSCRIPTION-NAME]
- List and set your Location
az group list
az configure --defaults location=australiaeast
- List and set your Resource Group
az group list
az configure --defaults group=[RESOURCE-GROUP-NAME]
- Create DNS records with
az network dns record-set a add-record --zone-name [ZONE-NAME] --ttl 600 --record-set-name [RECORD-NAME] --ipv4-address [IP-ADDRESS]
#SHORTER
az network dns record-set a add-record --zone-name [ZONE-NAME] --ttl 600 -n [RECORD-NAME] --ip [IP-ADDRESS]
- List DNS records with
az network dns record-set list --zone-name [ZONE-NAME]
- Delete one DNS record set with
az network dns record-set a delete --zone-name [ZONE-NAME] -n [RECORD-NAME]
- Create the aliases with the zone and ttl baked in
alias azcdns="az network dns record-set a add-record --zone-name [ZONE-NAME] --ttl 600"
alias azdns="az network dns record-set list --zone-name [ZONE-NAME]"
alias azddns="az network dns record-set a delete --zone-name [ZONE-NAME]"
- Use them like this (create / list / delete)
az-dns-create -n [HOSTNAME] --ip [IP-ADDRESS]
az-dns-list
az-dns-delete -n [HOSTNAME]