Azure / azure-cli

Azure Command-Line Interface
MIT License
3.92k stars 2.89k forks source link

DnsRecordIsReserved error #25604

Closed marcelo321 closed 1 year ago

marcelo321 commented 1 year ago

I am trying to create a vm with the following command:

az vm create -n whatevername -g FORVMGROUP --public-ip-address-dns-name somednsname --image ubuntults --size Standard_B1ls --generate-ssh-keys -l eastus2

And I am getting this error:

{"status":"Failed","error":{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"BadRequest","message":"{\r\n \"error\": {\r\n \"code\": \"DnsRecordIsReserved\",\r\n \"message\": \"DNS record somednsname.eastus2.cloudapp.azure.com is already reserved by another resource.\",\r\n \"details\": []\r\n }\r\n}"}]}}

So this is telling me the DNS name is reserved, but that dns name doesn't exist, so what's going on? was it manually reserved? how long will it be reserved?

yonzhan commented 1 year ago

@zhoxing-ms for awareness

zhoxing-ms commented 1 year ago

DNS record somednsname.eastus2.cloudapp.azure.com is already reserved by another resource.

Since this error message is returned by the REST service, it needs the service team to help investigate the root cause of the error message

ghost commented 1 year ago

Thank you for your feedback. This has been routed to the support team for assistance.

marcelo321 commented 1 year ago

Thanks, I am waiting!

navba-MSFT commented 1 year ago

@marcelo321 Apologies for the late reply. Thanks for reaching out to us and reporting this issue. The parameter --public-ip-address-dns-name should be a Globally unique DNS Name for the Public IP.

The DNS name label is an "A record" that starts with the specified label and resolves to this public IP address will be registered with the Azure-provided DNS servers. Example: mylabel.eastus.cloudapp.azure.com.

Action Plan:

  1. You could try checking first if somednsname.eastus2.cloudapp.azure.com is already in use.
  2. Please try to follow this article and check if you can try creating the dns for your VM from Azure portal. See if that suceeds.
marcelo321 commented 1 year ago

@navba-MSFT yeah I am checking if it exists and it gives NXDOMAIN status so should be fine, but I get that it already exists.

# dig @1.1.1.1 pg-fairy-web.azurewebsites.net

; <<>> DiG 9.18.1-1ubuntu1.3-Ubuntu <<>> @1.1.1.1 pg-fairy-web.azurewebsites.net
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 4997
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;pg-fairy-web.azurewebsites.net.        IN      A
# az webapp create --name pg-fairy-web --plan freeplan -g firstgroup --runtime 'php|7.4'
Webapp 'pg-fairy-web' already exists. The command will use the existing app's settings.
Unable to retrieve details of the existing app 'pg-fairy-web'. Please check that the app is a part of the current subscription
marcelo321 commented 1 year ago

Sometimes a friend creates a cloudapp, then deletes it and I can't create it with the same name (the app is deleted). Is there a minimum time we have to wait to create it again? Either that or something is failing at azure because I know for sure some resources names are available but can't use those.

I also noted my account gives "DNS name must be available." error, while the same resource from my friends account is available..? is my account blacklisted or something?

navba-MSFT commented 1 year ago

@marcelo321 I would suggest waiting for atleast 30 minutes before creating a resource with the same name. This will ensure that the ARM cache is synchronized and the references to the old resource names are deleted.

marcelo321 commented 1 year ago

@navba-MSFT I already waited more than 12 hours and still get the error both in the web UI and in the azure cli, while my other friends account see that is available. Something is wrong either in azure or my account, this shouldn't be happening.

Edit: I am logged in in both accounts (more than 12 hours since resource deleted). one gives resource not available and the other one gives resource available. I repeat, something is not working right.

navba-MSFT commented 1 year ago

@marcelo321 This might require a closer troubleshooting. Could you please open a support ticket with Microsoft so that our Support Professionals can look into this issue and assist you further.

navba-MSFT commented 1 year ago

@marcelo321 I wanted to do quick follow-up to check if you had a chance to look at my above comment. Please let us know if you had a chance to open a support ticket to troubleshoot this issue further. Awaiting your reply.

marcelo321 commented 1 year ago

Hi @navba-MSFT,

I don't have a support plan to make a ticket to support, it just lists me the available options to manually resolve the issue.

I am aware that sometimes there is a 7day time that no other account can create that resource to prevent subdomain takeovers, but I noticed that sometimes after +7 days I still can't create them.

navba-MSFT commented 1 year ago

@marcelo321 Thanks for your reply. As an alternative, You can check if a DNS name is available by running the following command:

az network public-ip list --query "[?dnsSettings.domainNameLabel=='']"

Replace with the DNS name you want to use. If the command returns an empty list, then the DNS name is available and you can use it for your VM's public IP address.

If the DNS name is not available, you can try using a different DNS name or contacting the person who reserved the DNS name to see if they can release it.

ghost commented 1 year ago

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

sumgr0 commented 1 year ago

Hi @navba-MSFT,

I've been facing this same issue and not sure of how to figure out, if the issue persists with my account or the service.

Please help.

marcelo321 commented 1 year ago

@sumgr0 My guess it is some protection against subdomain takeovers or something like that, otherwise it has no reasonable explanation.

It is not my account, it seems that is happening with all the accounts. If you create and delete a resource, after you delete it, it isn't available for everyone like before, seems like there are some protections that the azure cli team isn't aware of