How to set up a custom domain through the terminal on Chrome OS

I am on an HP Chromebook 14 - SMB, and I don’t know how to. Can someone please help?

Hi @hacker19374, welcome to the GitHub Support Community!

There’s not really a direct way to set up your custom domain via the terminal. We’d usually recommend you just add the domain from the repository settings page.

Pages attaches a custom domain to your repository by using a file called CNAME in the root of your site’s publishing source—the branch you select in the repository settings to publish your site from. GitHub creates this file automatically when you add the domain in the repository settings.

You can create this file from the terminal though. To do this you’ll need to create this CNAME file that contains the domain you want to attach:

echo > CNAME

Once you do this, commit and push to your repository and your custom domain should be attached to your Pages site!

As for setting up the DNS entries for your domain, it’ll depend on your domain/DNS provider but this will likely need to be done from their settings panel. The details on the required DNS settings for pointing your domain towards Pages are in this article:

There’s different settings depending on which type of domain you’re adding so be aware of which type you want!