# Error configuring custom domain to a canister

**URL:** <https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435>\
**Category:** Developers\
**Created:** [June 4, 2023, 9:45am UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435 "2023-06-04T09:45:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamenochchirima](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/iamenochchirima/32/21673_2.png) [@iamenochchirima](https://forum.dfinity.org/u/iamenochchirima)\
**Post date:** [June 4, 2023, 9:45am UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/1 "2023-06-04T09:45:27Z")

</div>

I am trying to host a canister under a custom domain following this documentation here [Internet Computer Loading](https://internetcomputer.org/docs/current/developer-docs/production/custom-domain/#well-knownic-domains).

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:

```auto
[
    {
        "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:

```auto
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:

```auto
< 
* 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.

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [June 4, 2023, 10:10am UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/2 "2023-06-04T10:10:45Z")

</div>

> [@iamenochchirima](#):
>
> My guess is that maybe I put the .well-known directory and the  
> .ic-assets.json at wrong places.

Looks like indeed your [https://j62gc-2iaaa-aaaal-qbynq-cai.icp0.io/.well-known/ic-domains](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?

> [@Custom Domain: Where should the .well-known directory be?](https://forum.dfinity.org/t/custom-domain-where-should-the-well-known-directory-be/20293/2):
>
> I’m using dfx for a custom domain in a single project only (in Juno this particular question is certified and handled automatically) and I’ve got the following configuration. In my app’s static asset folder, there is a single .ic-assets.json file. You can find an example here: [link](https://github.com/buildwithjuno/juno/blob/main/src/frontend/static/.ic-assets.json). Note that for SvelteKit, the folder is named static while with the React starter kit, it might be called assets (e.g., ./src/frontend/assets/). The .well-known directory is a sub-directory of the static assets …

---

<div class="post-metadata">

**Author:** ![iamenochchirima](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/iamenochchirima/32/21673_2.png) [@iamenochchirima](https://forum.dfinity.org/u/iamenochchirima)\
**Post date:** [June 4, 2023, 10:32am UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/3 "2023-06-04T10:32:40Z")

</div>

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

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

```

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

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

```

What could be wrong now?

---

<div class="post-metadata">

**Author:** ![iamenochchirima](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/iamenochchirima/32/21673_2.png) [@iamenochchirima](https://forum.dfinity.org/u/iamenochchirima)\
**Post date:** [June 4, 2023, 10:43am UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/4 "2023-06-04T10:43:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![iamenochchirima](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/iamenochchirima/32/21673_2.png) [@iamenochchirima](https://forum.dfinity.org/u/iamenochchirima)\
**Post date:** [June 4, 2023, 11:08am UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/5 "2023-06-04T11:08:20Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [June 4, 2023, 11:21am UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/6 "2023-06-04T11:21:42Z")

</div>

@iamenochchirima

Are you saying that:

- `https://todo.enochchirima.com` → cannot connect to backend ❌
- `https://j62gc-2iaaa-aaaal-qbynq-cai.icp0.io` → can connect to backend ✅

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.

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

```

---

<div class="post-metadata">

**Author:** ![iamenochchirima](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/iamenochchirima/32/21673_2.png) [@iamenochchirima](https://forum.dfinity.org/u/iamenochchirima)\
**Post date:** [June 4, 2023, 12:57pm UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/7 "2023-06-04T12:57:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [June 4, 2023, 1:25pm UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/8 "2023-06-04T13:25:59Z")

</div>

Awesome, happy to hear that 😃

---

<div class="post-metadata">

**Author:** ![ferMartz](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/fermartz/32/1421_2.png) [@ferMartz](https://forum.dfinity.org/u/ferMartz)\
**Post date:** [December 6, 2023, 5:15pm UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/9 "2023-12-06T17:15:54Z")

</div>

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?

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

```

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [December 6, 2023, 5:47pm UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/10 "2023-12-06T17:47:54Z")

</div>

> [@ferMartz](#):
>
> Do you have any suggestions on troubleshooting this issue?

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

---

<div class="post-metadata">

**Author:** ![ferMartz](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/fermartz/32/1421_2.png) [@ferMartz](https://forum.dfinity.org/u/ferMartz)\
**Post date:** [December 6, 2023, 5:57pm UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/11 "2023-12-06T17:57:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rbirkner](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@rbirkner](https://forum.dfinity.org/u/rbirkner)\
**Post date:** [December 6, 2023, 8:13pm UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/12 "2023-12-06T20:13:53Z")

</div>

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](https://internetcomputer.org/docs/current/developer-docs/production/custom-domain/dns-setup#apex-1). 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).

---

<div class="post-metadata">

**Author:** ![ferMartz](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/fermartz/32/1421_2.png) [@ferMartz](https://forum.dfinity.org/u/ferMartz)\
**Post date:** [December 6, 2023, 8:28pm UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/13 "2023-12-06T20:28:13Z")

</div>

Hello @rbirkner . Thanks for your quick response!

I followed the same guide you [pointed out](https://internetcomputer.org/docs/current/developer-docs/production/custom-domain/dns-setup#apex-1). I’m using AWS and the CNAME record looks like the shot below.  
Do I need to change the CNAME?

 ![Screenshot 2023-12-06 at 11.56.17 AM](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/7/77652592cbcf6412fc2584bee390e746382dd3d5.png)

---

<div class="post-metadata">

**Author:** ![rbirkner](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@rbirkner](https://forum.dfinity.org/u/rbirkner)\
**Post date:** [December 6, 2023, 8:54pm UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/14 "2023-12-06T20:54:21Z")

</div>

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:

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

```

And compare that to:

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

```

---

<div class="post-metadata">

**Author:** ![ferMartz](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/fermartz/32/1421_2.png) [@ferMartz](https://forum.dfinity.org/u/ferMartz)\
**Post date:** [December 6, 2023, 9:01pm UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/15 "2023-12-06T21:01:59Z")

</div>

> [@rbirkner](#):
>
> `dig AAAA audionaut.xyz +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

---

<div class="post-metadata">

**Author:** ![zensh](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/zensh/32/15359_2.png) [@zensh](https://forum.dfinity.org/u/zensh)\
**Post date:** [February 27, 2024, 8:33am UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/16 "2024-02-27T08:33:58Z")

</div>

> [@iamenochchirima](#):
>
> I am trying to host a canister under a custom domain

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

> [@"failed to create acme order" when configuring custom domain to a canister](https://forum.dfinity.org/t/failed-to-create-acme-order-when-configuring-custom-domain-to-a-canister/27920):
>
> I am trying to host a canister under a custom domain, Everything was ready, but it reported such a error: curl -sLv -X GET \ https://icp0.io/registrations/da0beb0015d850703b3f3afefa402c85adeaf82b2ead707eb63eb625a68185f9 {"name":"panda.fans","canister":"c63a7-6yaaa-aaaap-ab3gq-cai","state":{"Failed":"failed to create acme order"}}

---

<div class="post-metadata">

**Author:** ![Stephen-Kimoi](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/stephen-kimoi/32/28729_2.png) [@Stephen-Kimoi](https://forum.dfinity.org/u/Stephen-Kimoi)\
**Post date:** [June 27, 2024, 7:04am UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/17 "2024-06-27T07:04:13Z")

</div>

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

```auto
{"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?

---

<div class="post-metadata">

**Author:** ![rbirkner](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@rbirkner](https://forum.dfinity.org/u/rbirkner)\
**Post date:** [June 27, 2024, 7:50am UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/18 "2024-06-27T07:50:52Z")

</div>

Hey @Stephen-Kimoi

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

---

<div class="post-metadata">

**Author:** ![rbirkner](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@rbirkner](https://forum.dfinity.org/u/rbirkner)\
**Post date:** [June 27, 2024, 7:55am UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/19 "2024-06-27T07:55:55Z")

</div>

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:

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

```

---

<div class="post-metadata">

**Author:** ![Tevin-Isaac](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/tevin-isaac/32/26513_2.png) [@Tevin-Isaac](https://forum.dfinity.org/u/Tevin-Isaac)\
**Post date:** [June 27, 2024, 11:29am UTC](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435/20 "2024-06-27T11:29:03Z")

</div>

Thank you very much DFINITY Team 😃

[Next page](https://forum.dfinity.org/t/error-configuring-custom-domain-to-a-canister/20435.md?page=2)
