Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Subdomains and Custom Domains

From Nest Guides
Revision as of 00:51, 11 August 2024 by Haroon (talk | contribs) (Edited custom domain section to explain on new domain verification system)

Whilst a subdomain of https://hackclub.app is automatically configured for you when you sign up for Nest, you'll need to use the Nest CLI to configure new subdomains under your user subdomain (https://<username>.hackclub.app).

Subdomains

To configure any subdomains of your user subdomain of hackclub.app, you can simply run the following command where name is the name of the subdomain you want to add. For example, if your username is orpheus, and you'd like to configure drawing.orpheus.hackclub.app, then you would run nest subdomain add drawing.

nest subdomain add <name>

The Nest CLI will automatically configure the subdomain in the system and add a block to your Caddyfile to get you started. See Caddy for more information about the Caddyfile.

If you'd like to remove a subdomain from the configuration, you can run the following command which will remove it from the root Caddyfile.

nest subdomain remove <name>

Custom Domains

As well as having your https://<username>.hackclub.app subdomain, you can link a custom domain to your user account.

To configure a domain for your user account, add a CNAME record to your domain pointing to <username>.hackclub.app. For example, if your username was orpheus, you'd set your CNAME to orpheus.hackclub.app. If you're using Cloudflare or similar providers that reverse-proxies requests, make sure to disable proxying (on Cloudflare, this is the orange cloud).

If you're using a root domain and you can't add a CNAME, you can also add an ALIAS record (or manually add the A and AAAA records if you're feeling spicy). Set your ALIAS record to hackclub.app, or set your A record to 37.27.51.34 and AAAA record to 2a01:4f9:3081:399c::4.

Once you've followed either of those and the DNS has propagated, you can link the domain to your user account by running the following command. For example, orpheus may run nest domain add orpheus.com.

nest domain add <domain>


If you added the CNAME to your domain, congrats, you've now successfully linked your domain to your user account! The Nest CLI, just like with subdomains, has configured your domain and added a block to your Caddyfile. See Caddy for more information about the Caddyfile.

If you used an ALIAS (or the A/AAAA records), you'll need to add a secondary TXT record to your domain to verify ownership. Once added and propagated, run the command again and it should be linked to your user account!

If you'd ever like to remove a domain from your user account, you can run the following command which will remove it from the root Caddyfile.

nest domain remove <domain>