Skip to content
Custom domains

Custom domains

A custom domain is a domain name that you own and manage, for example www.example.org.

Unlike a Gitnet Forge account domain, you are responsible for configuring the DNS records for a custom domain and proving that you are authorized to publish to it.

Configure your DNS record

Before deploying your website, create a CNAME record with your DNS provider. Point the hostname you want to use (for example, www.example.org) to gitnet.page.

DNS propagation may take some time. Once the record is active, you can deploy your website using your custom domain.

Prove domain ownership

Generate a DNS challenge for the domain:

$ git-pages-cli https://www.example.org --challenge

The command generates a random password and displays a TXT record to publish. Add the record to the DNS zone for your domain exactly as printed by the command.

password: aaaaaaaa-bbbb-cccc-dddd-....
_git-pages-challenge.www.example.org. 3600 IN TXT "abcdef..."

You can also provide your own password:

$ git-pages-cli https://www.example.org --password xyz --challenge

To print only the challenge value, use --challenge-bare:

$ git-pages-cli https://www.example.org --password xyz --challenge-bare

Publish the website

Once the domain has been configured and the challenge is in place, publish your site directory:

$ git-pages-cli https://www.example.org \
    --password xyz \
    --upload-dir site-contents

You can also publish directly from a public Git repository:

$ git-pages-cli https://www.example.org \
    --password xyz \
    --upload-git https://gitnet.fr/username/example.org.git

First HTTPS publication

The server cannot obtain a TLS certificate for a domain before a site has been published on it. For the first publication, use HTTP or specify a hostname for which the server already has a certificate:

$ git-pages-cli https://www.example.org \
    --server gitnet.page \
    --password xyz --upload-dir site-contents

Replace gitnet.page with the certified hostname provided by your administrator.

Redirect one domain to another

For example, redirect www.example.org to example.org:

$ git-pages-cli https://www.example.org \
    --password xyz \
    --redirect https://example.org