Error creating custom domain for a backend canister via candid interface

I added .well-knonw folder and ic-assets.json file in the backend_canister at root level and deployed to the mainent. But they are being ignored. and when i tried to give a custom domain to the canister interface of the backend_canister with:
curl -sLv -X POST
-H ‘Content-Type: application/json’
https://icp0.io/registrations
–data @- <<EOF
{
“name”: “custom-domain”
}
EOF
but i got the error:
failed to retrieve known domains from canister - canister-id.

I’ve not idea of Motoko, since you tagged this issue in that section, I’m not sure I’m the best to answer. However, the .well-known/ic-domains file to set up a custom domain should probably be placed on your frontend canister. Hope that helps.

I have accidentally selected the motoko tag. And as you have mentioned the files should be placed in frontend canister, yes i have created custom domain for the frontend. but i want to create a custom domain for backend canister to manage some of the canister calls through the domain.

Your backend canister has to expose the ./well-known/ic-domains though a certified http_request which is a function pre-implemented, I guess, in your frontend canister but, you may not have implemented?

(As a bystander…) That name seems to contain a typo. Please double-check to exclude a pilot error.

1 Like

The file name is correct in the code it is mistaken while im typing the query here.

Can you help me implementing the http_request, the ICP AI also suggested the same solution but i dont know how to do it.

1 Like

Not really. In this example listed on the website, they mention an example, but it leads to a 404. Today, someone posted a similar question on the forum, where they encountered an error related to certification. Perhaps someone could share a working example.

I will check the those links.