If you've purchased a custom domain from a registrar, you can add it to your Glitch project!
To add a custom domain:
- Open the project in the editor.
- Click Tools at the bottom of the page.
- Click Custom Domains.
- Enter your custom domain URL (www.website.com) and then click Add Domain.
- Now, go to your domain name registrar's website and create a CNAME entry, adding glitch.edgeapp.net as the target.
Here are some things to remember when adding a custom domain to your Glitch project:
- Visiting the url, http://glitch.edgeapp.net directly in your browser will not display your app. It’s not intended to be used directly, only as part of a CNAME.
- If you are working on a generated static site (GSS), referring to the custom domain during active development will not work. Instead, be sure to reference the project's glitch.me domain. Once the site is ready, you can point folks to the custom domain.
- Currently, web socket connections do not work with custom domains on Glitch. If your Glitch projects use custom domains and web sockets, you will need to set them up so that the apps are connected via their glitch.me URL.
- While you can connect a number of custom domains to your app, only the first five will appear in the custom domain menu after they have been added.
- Most popular domain name registrars provide documentation on how to configure your dns for CNAMES. Here are links to a few of them:
Using an A Record when your domain name registrar requires an IP address:
- If you want to use the "bare domain" (for example,
www.website.com), you'll need to create an A Record.
- If you're setting an A record for a host, you do not need a CNAME for it too. Make sure there are no duplicates or else your domain may not resolve!
- If your registrar requires an A Record to be pointed to an IP address instead of a URL, you can find the IP address by using a service like Ping.eu to ping http:// glitch.edgeapp.net.
- Here are documentation links for how to add an A record with some popular domain name registrars: