Custom Domains Help


#1

So I started registering a custom domain, 1001api.cf, so i added that into the custom domain field, then i read something about bare domains and that i need to add www. so I got worried and then registered it a second time but then doing www.1001api.cf and i dont know if im breaking stuff right now.
Will everything be ok and running once the dns changed are detected or do i need to do something?


#2

Hey @SammyWhamy I see both of those domains registered to the same project in Glitch/Fly.io but no DNS records (looking here, for example).

If you care to share a screenshot of your whole DNS config we can try to see if we can figure out what’s going on


#3

Yes of course, here is my DNS config on freenom:

“GLITCH” is the one I set up where I entered “1001api.cf”
“GLITCH2” is the one I set up where I entered “www.1001api.cf”


#4

Hey @SammyWhamy, this is part of how DNS records are made complicated to use, unfortunately. Sorry for the bother, and let’s see if we can clarify things a little.

Your DNS record is made up of a top-level domain (or TLD), which in your case is .cf

Then they have the second-level domain, the name part (1001api in your case). Those two things combine to make what some folks call the Apex domain - the one without any subdomains. In your case 1001api.cf.

In the Freenom configuration screen they’re calling the subdomain portion the “Name”, but that’s misleading - it makes you think you’re just giving it a label, but in fact that’s the actual subdomain portion. So here you’ve set up CNAME records for two different subdomains: glitch.1001api.cf and glitch2.1001api.cf. You can verify this using the dig tool if you’re on a Mac or Linux box and there’s a web version you can use; here’s a link to the results for the records you’ve created: https://www.digwebinterface.com/?hostnames=glitch.1001api.cf glitch2.1001api.cf&type=CNAME&showcommand=on&colorize=on&ns=resolver&useresolver=8.8.4.4&nameservers=

If you replace GLITCH2 with www then that record should work. I don’t use Freenom, so I can’t say if you’ll be able to use a CNAME for the 1001api.cf record; that’s technically unsupported by the DNS specifications. You can read more about that in our help article about this here, but there’s a good chance you’ll need an IP address for that record instead. You can use a tool like https://www.ultratools.com/tools/dnsLookupResult to look up the IP address (the A record) for 3wq0zxo0s9fdxpmk.shw.io.

One last thing - the *.shw.io domains are actually out of date - you should be able to use glitch.edgeapp.net for all of those records, which can make all of this a tiny bit simpler.

Hope this helps!


#5

Thanks a lot for the help, how would I use the glitch.edgeapp.net?


#6

You can use that anywhere you would otherwise use a *.shw.io address.


#7

Ah okay, I suppose I have to change something in that url to make it link to my project?
Since the *.shw.io things have a custom code for every project, I guess I’ll have to do something like glitch.{myappname}.net?

Edit: the domain www.1001api.cf works now, so that’s amazing!


#8

Also, would there be any way to secure the connection via https?
maybe cloudflare? :thinking:


#9

The glitch.edgeapp.net address is fly.io’s, and they take care of the internal mapping between your custom domain and that address, so that value by itself is plenty. Glad you got the www part working!

Last time I checked, there was something about the way that fly.io forwarded traffic that makes it difficult to force https, but I’d have to look again to see if there’s a way to work around that. CloudFlare might be able to help with that; to be honest I’ve never tried.


#11

Ah okay, that’s amazing, thanks a lot for you help!
PS. I have another question, but I’ll make a new topic for that since it’s not related