Back

CNAME and A DNS records for Appwrite functions

  • 0
  • Self Hosted
  • Functions
liga
17 Nov, 2023, 16:11

ok, so it would be <function_id>.mycname.com ?

TL;DR
The user is trying to set up CNAME and A DNS records for Appwrite functions. They are confused about how to point specific functions to a domain and whether they need to create separate A records for each function. The user is also trying to create a wildcard CNAME record. The solution is to create a wildcard A record instead of a CNAME record, and each function can have its own A record with the format <function_id>.mycname.com.
liga
17 Nov, 2023, 16:12

For that I would need a A record

liga
17 Nov, 2023, 16:13

If that's the case, this CNAME inside the function would be useless, it would be the same as the project CNAME

Drake
17 Nov, 2023, 16:15

No, a cname record pointing *.mycame.com to your appwrite instance

Drake
17 Nov, 2023, 16:15

The custom function domain is for an additional custom one different than the default function domain

Drake
17 Nov, 2023, 17:15

For example, on cloud we have our app domain as cloud.appwrite.io. we have *.appwrite.global pointing to cloud.appwrite.io and appwrite.global configured as the function domain so that when a function is created, people get a url for their function automatically. However, if people want a custom one like mycustom.domain, they can add a custom function domain

liga
17 Nov, 2023, 17:36

Ok, but every function will need it's own A record right?

liga
17 Nov, 2023, 17:36

<function_id>.whateverdomain.com

Drake
17 Nov, 2023, 17:36

No, CNAME if you want a custom one

liga
17 Nov, 2023, 17:36

Then how do I point the specific function to the domain

liga
17 Nov, 2023, 17:37

Tha'ts what I'm doing right now and it's not working

liga
17 Nov, 2023, 17:38

I have my appwrite main domain at appwrite.mydomain.com: A record to my server IP

liga
17 Nov, 2023, 17:39

if I create a CNAME to that domain on my function settings, it will be just a CNAME to that domain, the server has no clue which function it is

liga
17 Nov, 2023, 17:39

a cname is an alias

Drake
17 Nov, 2023, 17:39

No, you create a wildcard one so that *.whateverdomain.com points to your main domain

liga
17 Nov, 2023, 17:40

oh, ok, but that wildcard is an A record

Drake
17 Nov, 2023, 17:40

No CNAME

Drake
17 Nov, 2023, 17:42

The point is to make it so you don't have to change multiple DNS records if your IP address needs to change

liga
17 Nov, 2023, 17:50

I've done that, created a CNAME wildcard *.fun.myotherdomain.com pointing to my appwrite.mydomain.com, but still error

liga
17 Nov, 2023, 17:51
liga
17 Nov, 2023, 17:51

Sure, that's what we want, to have everyting organized

Drake
17 Nov, 2023, 18:17

Is this from a function from before you set the environment variable?

liga
17 Nov, 2023, 18:28

Nope, it's the regular function

liga
17 Nov, 2023, 18:28

no env vars, just a console log

Drake
17 Nov, 2023, 20:23

I meant the function domain env var

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more