Mike Williamson
Mike Williamson

Reputation: 3198

List all DNS's (FQDN's) in an Azure Resource Group, Tenant, or Subscription

Background

I tried to launch a container and associate a DNS name with it upon creation. The first time I tried, it failed because it said that the DNS name was already used. Specifically, it said:

The DNS name label 'miketest' in container group 'mike-portal-test' not available. Try using a different label.

I realized that this DNS name is global, using the FQDN of miketest.westeurope.azurecontainer.io, so that was obviously taken. I quickly solved the problem by choosing a less boring test name.

Problem

But it got me wondering: how can I see if I have left any "lingering" FQDNs / DNS names out there in my resource group (or subscription or tenant)? I could not find a way to list the DNS names that I have made.

I found this in the Azure docs:

az network dns record-set list --resource-group myresourcegroup --zone-name contoso.com

But it requires a zone-name and it only allows privately created zone names, so that I cannot pass the zone westeurope.azurecontainer.io. An attempt to use the previous command using the zone name westeurope.azurecontainer.io yielded the following error:

ResourceNotFoundError: Can not perform requested operation on nested resource. Parent resource 'westeurope.azurecontainer.io' not found.

How can I list what DNS's I have created? Can I assume that any resources that I delete which have DNS names associated automatically have their DNS names deleted upon deletion of the resource?

Upvotes: 0

Views: 1899

Answers (1)

Nancy Xiong
Nancy Xiong

Reputation: 28224

How can I list what DNS's I have created?

It's difficult to answer this question because FQDN is global. The name must be unique within the Azure region where you create the container instance. Your container will be publicly reachable at <dns-name-label>.<region>.azurecontainer.io. It not only exists on your resources but also other services in the global DNS by using container suffix .westeurope.azurecontainer.io. You can't list other customer resources using the same container suffix here.

Can I assume that any resources that I delete which have DNS names associated automatically have their DNS names deleted upon deletion of the resource?

Yes. The Azure DNS name above will be deleted automatically if the resource is deleted.

Upvotes: 1

Related Questions