CNAME configuration instructions confusing


#1

The instructions for setting up custom domains in Website Settings says: “To enable a custom domain, add it using the form below, and then configure a new CNAME record with your DNS provider to point it at treshenry-net.vapid.site .”

The problem is that CNAME records are meant to handle cases like resolving the A record for mydomain.com when www.mydomain.com is requested. CNAME records can’t be used for the Vapid hosting use case because CNAME records are not allowed to exist for the root domain (according to spec). I figured this out when trying to configure DNS with Joker for my domain name to resolve my Vapid hosted site.

For more detail here’s a good article (as I know basically nothing about DNS): https://medium.freecodecamp.org/why-cant-a-domain-s-root-be-a-cname-8cbab38e5f5c

I’m experimenting right now with Joker’s “URL forwarding” feature to see if I can get that to work for this case. I’ll update this topic with my results.


#2

I just went to see how Squarespace handles this: https://support.squarespace.com/hc/en-us/articles/205812378-Connecting-a-domain-to-your-Squarespace-site

They want you to transfer your domain to their own registrar. They do support (but discourage) some 3rd party registrars and include instructions for a handful which look to be using some combination of A, CNAME, and custom features of the registrar. Joker is not included as a supported registrar which makes me think I’m probably not going to be able to use it for Vapid hosting either. :frowning:


#3

Quick update: it is possible to (sort of) configure Joker to work with Vapid hosting using the URL Forward feature which basically just sets up nginx to serve a 301 to the configured domain. It works but what the user sees in the URL bar is the Vapid URL not the desired URL.


#4

@ohnoimdead Unfortunately, this is a pretty common issue for most web hosts, including Vapid. To recap what you said, CNAME let you point subdomains to another resource (e.g., www.example.com can be CNAMEd to example.vapid.site), however most registrars won’t let you CNAME the root domain (e.g., example.com can’t be CNAMEd to example.vapid.site). Some registrars support an ANAME/ALIAS record for this purpose, but there isn’t wide support.

Fortunately, like you said, most registrars do support URL forwarding, so there’s a workaround:

  1. Setup URL forwarding to redirect example.com to www.example.com
  2. Create a CNAME record to point www.example.com to example.vapid.site

Let me know if that works.


#5

Ah, interesting hack. Just verified that works for Joker. Maybe this just needs some better documentation then? “configure a new CNAME record with your DNS provider to point it at mysite.vapid.site” didn’t set me on the right path I think.


#6

Good point. I’ll make a note to update the docs and/or wiki.