# Does DNS sharing rely on API key duration?

**URL:** <https://forum.storj.io/t/does-dns-sharing-rely-on-api-key-duration/24608>\
**Category:** DCS\
**Tags:** custom-domain, uplink, dns\
**Created:** [December 7, 2023, 5:57pm UTC](https://forum.storj.io/t/does-dns-sharing-rely-on-api-key-duration/24608 "2023-12-07T17:57:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gatomo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/gatomo/32/1128_2.png) [@gatomo](https://forum.storj.io/u/gatomo)\
**Post date:** [December 7, 2023, 5:57pm UTC](https://forum.storj.io/t/does-dns-sharing-rely-on-api-key-duration/24608/1 "2023-12-07T17:57:15Z")

</div>

Hi! I have a question related to sharing an entire bucket with a custom domain. Is the first time I do this.

Actually I have a bucket that I share with a custom domain through Cloudflare CDN. I read [the “custom domains” documentation](https://docs.storj.io/dcs/code/static-site-hosting/custom-domains) that explains very well how to do it, but I noticed about something related to access.

If I create an API key (to use in uplink to share) with an end date (e.g. 24 hours), when I try to access some file after that time I get an error that says me “Acces denied” (even if I set the `--not-after=none` option when sharing), but if I create an API key with no end date it works without problem.

That confuses me because I don’t see nothing about that at documentation. Is that true or is just some issue of mine? I just want to confirm it.

Thanks

---

<div class="post-metadata">

**Author:** ![tylkomat](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/tylkomat/32/62_2.png) [@tylkomat](https://forum.storj.io/u/tylkomat)\
**Post date:** [December 7, 2023, 7:02pm UTC](https://forum.storj.io/t/does-dns-sharing-rely-on-api-key-duration/24608/2 "2023-12-07T19:02:57Z")

</div>

That is correct. The API key is the “key” that enables you to share a bucket in the first place. If that key expires the corresponding share is not valid anymore and expires as well.
