Custom name already associated ... find it and remove it. But I can't find it!

I'm getting the error message that my custom domain is already in use in pages. I can't find it anywhere else. The first error was a 1016. Now I'm getting Connection Timed Out. Maybe it just needs to propagate? Can you add the pages url directly to the DNS? That's not normally what I do but trying to add it through the pages settings/custom domain didn't work. How to go about resolving this? I removed all CNAME records. Then I added back www and a second record I populated directly with the pages url. Still not working. I've done a few other things from the dashboard and using Curl. Also, why am I prompted to add an A record or CNAME for a top-level domain I registered with Cloudflare? I removed the A record today that pointed to an old server. But my Dig commands and DNS lookups show my domain using the Clouflare servers.
20 Replies
Erisa
Erisaā€¢2mo ago
Can you add the pages url directly to the DNS?
No, you have to add to Custom Domains, it doesn't work otherwise. Have you checked your other projects to ensure they don't have Custom Domain entries for the domain?
Also, why am I prompted to add an A record or CNAME for a top-level domain I registered with Cloudflare?
What do you mean? Where are you being told to do this?
cris
crisā€¢2mo ago
@Erisa Thanks for the help. I removed the CNAME that I manually added (a few hours ago).
Yes, I went through my 26 other page projects. None was using this domain. I'll chack again. Is there a way to run a search?
When I visit my DNS page , at the top, it gives recommended steps to complete the zone setup. I'm prompted to "Add an A, AAAA or CNAME record for your root domain so that [it] will resolve".
Erisa
Erisaā€¢2mo ago
Is there a way to run a search?
There is not, sadly
When I visit my DNS page , at the top, it gives recommended steps to complete the zone setup. I'm prompted to "Add an A, AAAA or CNAME record for your root domain so that [it] will resolve".
Ah I see, it's not wrong but in this case for Pages you'll need to add the Custom Domain instead (which you obviously, are being prevented from doing) Since you can't find it I suspect something may be stuck on the backend, to fix that I'd have to escalate this thread to Cloudflare and it would be best if you were able to share the domain so they have the context when I do that
cris
crisā€¢2mo ago
It's mexicanbold.com. Again, thanks for the help! BTW, a subdomain, shop.mexicanbold.com works.
Erisa
Erisaā€¢2mo ago
I escalated this thread so someone from Cloudflare will check when they're available
cris
crisā€¢2mo ago
Great. That's terrific. Hopefully I'll have an update soon. Take care.
Andronicus
Andronicusā€¢2mo ago
Hi @cris do you happen to have a Support case open?
cris
crisā€¢2mo ago
@andronicus Hi. I do not (though I tried).
Andronicus
Andronicusā€¢2mo ago
No worries, sent you a DM, hope that helps.
cris
crisā€¢2mo ago
@Erisa Update: @andronicus found the project to which the custom name was already attached. So that was the problem. (I looked through once but had blinders on apparently.) I added the custom domain and all is working as expected. Feels great!
Erisa
Erisaā€¢2mo ago
No problem, thanks @andronicus for spotting that
Andronicus
Andronicusā€¢2mo ago
Thanks for your confirmation, @cris. Unfortunately, as of today, there's currently no easy way to run a search from Cloudflare Dashboard yet. The closest thing you can do which popped up in my mind is to programmatically run Cloudflare API calls. Get your Pages Projects, and the Custom Domain(s) for each Project. May need to check for Workers Domains, too. * https://developers.cloudflare.com/api/operations/pages-project-get-projects * https://developers.cloudflare.com/api/operations/pages-domains-get-domains * https://developers.cloudflare.com/api/operations/worker-domain-list-domains Happy to help! šŸ˜ƒ
cris
crisā€¢2mo ago
Really nice of you to offer so much direction. I'll definitely revisit the API calls. The instructions I saw weren't that clear (I sometimes need crystal clarity and hand-holding, lol). For example, I couldn't find the Pages API Key which was referenced in the community forum (https://community.cloudflare.com/t/that-domain-is-already-associated-with-an-existing-project/579186) and the API docs weren't that easy for me to follow: I got error messages such as "{"result":null,"success":false,"errors":[{"code":7003,"message":"Could not route to...." Thanks @andronicus.
Erisa
Erisaā€¢2mo ago
Them calling it a pages API key is slightly misleading since what you want is actually an API token https://dash.cloudflare.com/profile/api-tokens specifically one with Cloudflare Pages read permisions:
No description
Erisa
Erisaā€¢2mo ago
the "Could not route to" error could be due to using the wrong api path or incorrectly providing a param such as the account ID into the path, hard to advise on that one without knowing what was tried
cris
crisā€¢2mo ago
@Erisa For example, I tried: curl --request DELETE --url https://api.cloudflare.com/client/v4/accounts/'a3c881b.......4ae0'/pages/projects/01-com-mexicanbold --header 'Content-Type: application/json' --header 'X-Auth-Email: [email protected]'
When running this commands, I tried within {}, removing the brackets, without and with quotes or apostrophes, etc. How should they be run? Did I miss the instructions?
Another time I tried: curl --request DELETE --url https://api.cloudflare.com/client/v4/accounts/477082f5c9678c608889bd8f03f7b807/pages/projects/01-com-mexicanbold/domains/mexicanbold.com --header 'Content-Type: application/json' --header 'Authorization: Bearer a3c881b0456e1947..... Sometimes I used my Account ID' and not the API key. I don't have any API keys except Global API Key and Origin CA key. {"success":false,"errors":[{"code":9106,"message":"Missing X-Auth-Key, X-Auth-Email or Authorization headers"}]} šŸ‘ I need to spend some time learning how to run those api calls from Curl.
Erisa
Erisaā€¢2mo ago
Cloudflare Docs
Make API calls | Cloudflare Fundamentals docs
Once you create your API token, all API requests are authorized in the same way. Cloudflare uses the RFC standard ā†— Authorization: Bearer <API_TOKEN> interface. An example request is shown below.
cris
crisā€¢2mo ago
That's what I was missing!
Erisa
Erisaā€¢2mo ago
one important thing is that api key and api token are different things api tokens are explicitly created by you and are scoped to certain permissions, they're used with the Authorisation header set to "Bearer <token>" (don't include the <>) whereas api key is the global one displayed on the dash and uses x-auth-email and x-auth-key headers, these are legacy and not recommended If you use the wrong type of key/token in the wrong way you'll get errors the api doc pages for endpoints currently are unclear about this and recommend some odd things, better to supplement them with the "make api calls" guide
cris
crisā€¢2mo ago
I'm going to redouble my efforts to get better at API calls. Thanks @Erisa for the link the guide. That's probably exactly what I need. And actually I just looked at the API settings page and only now realized that there's a difference between the Keys and Tokens. Helps that you pointed it out.
Want results from more Discord servers?
Add your server