How to set alias record set for cname
See original GitHub issueThe CLI command creates the record without issue az network dns record-set cname set-record -g MyResourceGroup -z www.mysite.com -n MyRecordSet -c www.contoso.com
The problem seems to be that when the CNAME is created there’s no way to set the ALIAS RECORD SET flag to yes via the CLI?
Perhaps I need to execute a follow-up command?
_Originally posted by @sspott in https://github.com/Azure/azure-cli/issues/13382#issuecomment-653297037_
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Choosing between alias and non-alias records
Unlike a CNAME record, you can create an alias record at the top node of a DNS namespace, also known as the zone...
Read more >Tutorial: Create an alias record to refer to a zone resource ...
In the Overview page of contoso.com DNS zone, select the + Record set button. · In the Add record set, enter test in...
Read more >How to create an ALIAS record - Domains - Namecheap.com
To set up an ALIAS record, follow these steps: · 1. Sign in to your Namecheap account. · 2. Select Domain List from...
Read more >Creating a cname record - how to set the alias #13382 - GitHub
az network dns record-set cname create --resource-group $dnsResourceGroup --zone-name $zone --name jfl but the "Alias" value is blank when I ...
Read more >AWS Route 53 Alias vs CNAME
Alias records only support A or AAAA record types · CNAME record redirects DNS queries for a record name regardless of the record...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@TeamDman
--target-resource
is used in record set. So it is available inaz network dns record-set a create
andaz network dns record-set a update
I was able to create an alias record using the
--target-resource
flag. I’m creating A record rather than a CNAME. I arrived here from a Google search about how to create an Alias record at the domain apex. From the documentation, it looks like that flag is available when creating a CNAME too.Here’s what I’m using (in Github Actions):
front_door_id=$(az network front-door show --name ${{ env.front_door_name }} --query id -o tsv)
az network dns record-set a create --name "@" --zone-name ${{ env.domain_name }} --target-resource $front_door_id
It looks like you can do similar for a CNAME by using
az network dns record-set cname create ...
. I put together the above commands based on this StackOverflow question: https://stackoverflow.com/questions/58316973/how-to-create-dns-a-record-usin-azure-cli-or-terraform