Error configuring custom domain to a canister

I am trying to host a canister under a custom domain following this documentation here Internet Computer Loading.

I am using goDaddy, I tried to set the DNS records correctly as per the documentation.
I then created the .well-known directory in the root directory, the one with the dfx.json file. Inside it I created the ic-domains as a plain file without any file type extension and put my custom domain name lilke foo.bar.com .
I aslo created the .ic-assets.json file in same root directory with the .well-known directory. and the dfx.json file and put the contents:

[
    {
        "match": ".well-known",
        "ignore": false
    }
]

and then deployed the canister on the ic.
That’s pretty much all the setup I followed, but now when I start the registration process with the following commnand:

curl -sLv -X POST \
    -H 'Content-Type: application/json' \
    https://icp0.io/registrations \
    --data @- <<EOF
{
    "name": "<custom_domain>"
}
EOF

I am gettin a bunch of data for the request and then finally this:

< 
* Connection #0 to host icp0.io left intact
domain is missing from canister j62gc-2iaaa-aaaal-qbynq-cai list of known domain

This is where I am stuck, My guess is that maybe I put the .well-known directory and the
.ic-assets.json at wrong places. Where am I going wrong?
Thank you.

Looks like indeed your https://j62gc-2iaaa-aaaal-qbynq-cai.icp0.io/.well-known/ic-domains file is not available.

Have recently answered a question about where to put the file, maybe you find something there?

3 Likes

Thank you, that worked and I got the ID back and then I run this command:

curl -sLv -X GET \
    https://icp0.io/registrations/ID

But the process have failed, I got this response back:

{"name":"todo.enochchirima.com","canister":"j62gc-2iaaa-aaaal-qbynq-cai","state":{"Failed":"failed to create acme order"}}

What could be wrong now?

1 Like

I run the command again, it returned Available, its working now.

1 Like

@peterparker , The custom domain is working now, but it seems like the frontend canister have lost its connection with the backend canister, It’s no longer querying items from backend if I access it using the custom domain name, but still working well if I use the canister id url, what other changes must I do so that the frontend and backend canisters keeps communicating with this new domain? I tried adding the new domain name to the CSP headers in the ic-assets.json file but it seems to have done nothing.
Thanks

@iamenochchirima

Are you saying that:

  • https://todo.enochchirima.com → cannot connect to backend :x:
  • https://j62gc-2iaaa-aaaal-qbynq-cai.icp0.io → can connect to backend :white_check_mark:

Do I get it right?

If yes, that’s maybe an issue with the HttpAgent. Try to path https://icp0.io as host for mainnet.

e.g.

new HttpAgent({ identity, host: 'https://icp0.io' });
2 Likes

Yes that was the case, I implimented like that and it’s working now. Thanks again

1 Like

Awesome, happy to hear that :smiley:

Hi @peterparker, thank you for your advice, which guided me in adding the .well-known folder to the frontend public directory. The documentation wasn’t particularly clear on this, but your input made a difference.

I’ve successfully received a registration confirmation message, and the status query indicates that everything is available. According to the documentation, it may take a few hours for the changes to propagate. However, it’s been over 15 hours, and the custom domain still doesn’t display anything.

Do you have any suggestions on troubleshooting this issue?

* Connection #0 to host icp0.io left intact
{"name":"audionaut.xyz","canister":"km6x3-2iaaa-aaaap-qb36q-cai","state":"Available"}%  

Yes I’ve got an excellent suggestion, I gonna forward (right now) your message to my colleagues who know the domain the best :wink:.

Thanks @peterparker I’ll dm you now a screenshot of the DNS config

Hello @ferMartz

There is one part missing in your configuration:
The CNAME from audionaut.xyz to icp1.io. If you cannot set a CNAME for your domain with your registrar, then you might want to consider the alternatives explained here. In short, some registrars don’t allow CNAMEs for apex domains. Some offer an ANAME or ALIAS record instead. If nothing like that is possible, we recommend to switch to a DNS provider that allows CNAMEs for apex domains (e.g., Cloudflare).

Hello @rbirkner . Thanks for your quick response!

I followed the same guide you pointed out. I’m using AWS and the CNAME record looks like the shot below.
Do I need to change the CNAME?

Unfortunately, Amazon Route 53 doesn’t support CNAME for apex domains. You specified a CNAME for the subdomain @.audionaut.xyz and not audionaut.xyz.

You can verify that by directly querying the DNS records for you domain and you will see that the response is empty:

$ dig AAAA audionaut.xyz +short
$ dig A audionaut.xyz +short

And compare that to:

$ dig AAAA icp1.io +short
$ dig A icp1.io +short

@rbirkner got it. Thanks for the explanation!

I just moved the domain to cloudflare and added the records.
I will wait for replication. After that, do I need to notify the boundary node?

Never mind, I just checked and everything is working!!!

Thanks again…and to @peterparker

2 Likes

I have got “failed to create acme order” too, How did you solve it?

I passed all the steps but when I run the command for checking the status of my registration request I am getting the error:

{"name":"icphubkenya.io","canister":"ucnis-pqaaa-aaaal-qjgla-cai","state":{"Failed":"failed to delete dns record"}

What does it mean and how can I solve it?

1 Like

Hey @Stephen-Kimoi

This sounds like a problem on our end. Let me look into it and I will get back to you!

I checked and it was actually a temporary issue. The system failed to remove the TXT record that it had to put in place for the ACME-challenge. However, all the steps are retried after failures. Hence, it worked in a later attempt and now your custom domain is available:

{"name":"icphubkenya.io","canister":"ucnis-pqaaa-aaaal-qjgla-cai","state":"Available"}
1 Like

Thank you very much DFINITY Team :smiley:

1 Like