One time steps to use the custom domain icgpt.onicai.com
:
-
Define the DNS records as described in step 1 of IC Custom Domain Docs
You can verify everything is propagating with "dig":
% dig CNAME icgpt.onicai.com ;; ANSWER SECTION: icgpt.onicai.com. 3600 IN CNAME icp1.io. % dig CNAME _acme-challenge.icgpt.onicai.com ;; ANSWER SECTION: _acme-challenge.icgpt.onicai.com. 3600 IN CNAME _acme-challenge.icgpt.onicai.com.icp2.io. % dig TXT _canister-id.icgpt.onicai.com ;; ANSWER SECTION: _canister-id.icgpt.onicai.com. 3600 IN TXT "4v3v2-lyaaa-aaaag-abzna-cai"
-
Created this file
src/frontend/domain-info/.well-known/ic-domains
:
icgpt.onicai.com
icgpt.icpp.world
Notes:
- we will keep both domains active for now
- Instead of a file
domain-info/.ic-assets.json
as explained in the docs, I added this content tosrc/frontend/src/.ic-assets.json5
:
{
"match": ".well-known",
"ignore": false
},
Note that the name domain-info
is something I chose.
-
Updated the
CopyPlugin
ofwebpack.config.js
to copy these files into thedist/frontend
folder during build. -
Deploy & verify that files are included in
dist/frontend
during build:
# First deploy these local, so all bindings are created
dfx start --clean
dfx deploy internet_identity
dfx deploy canister_frontend
# Then deploy to ic
dfx deploy --ic canister_frontend
- Initiate the registration of domain with IC this command & check that the output looks similar as:
$ curl -sLv -X POST \
-H 'Content-Type: application/json' \
https://ic0.app/registrations \
--data @- <<EOF
{
"name": "icgpt.onicai.com"
}
EOF
...
* Connection #0 to host ic0.app left intact
{"id":"xxx..."}
- Query the status, using the REQUEST_ID: (You might need to repeat this several times before everything is 'approved')
$ curl -sLv -X GET \
https://ic0.app/registrations/xxx
...
# once approved
* Connection #0 to host ic0.app left intact
{"name":"icgpt.onicai.com","canister":"4v3v2-lyaaa-aaaag-abzna-cai","state":"Available"}