question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to set alias record set for cname

See original GitHub issue

The 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?

dns2

_Originally posted by @sspott in https://github.com/Azure/azure-cli/issues/13382#issuecomment-653297037_

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
kairu-mscommented, Aug 16, 2021

@TeamDman --target-resource is used in record set. So it is available in az network dns record-set a create and az network dns record-set a update

2reactions
davidcarbonicommented, Sep 29, 2020

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

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found