- First you need to create a pull request with your
domains/my-domain.jsonfile - This PR will be reviewed
- The changes will take effect soon after the PR gets merged
- And that's it
- A github pages json file (with cname record and https redirection) will look something like this -
{
"description": "Add some description",
"repo": "https://github.com/github-username/github-username.github.io",
"owner": {
"username": "github-username",
"email": "any@email"
},
"record": {
"CNAME": "github-username.github.io",
"URL": "https://your-domain.is-a.dev"
}
}- After the pull request is merged, you will see a 404 error on
your-domain.is-a.dev. To fix this go to your github page repo'sSettings > Github pages > Custom domainand addyour-domain.is-a.devin the given field - If you have added the
URLrecord for forced https, check theEnforce HTTPScheckbox too
The way you register your own domain name is through a pull request.
To register my-domain.is-a.dev, you need to create a domains/my-domain.json file
The file name must pass the following criteria -
- Must be alpha numeric with dashes as seperators
- Must be more than 2 characters long
The file needs to have the following fields -
You need to specify some information about yourself here. This is so that you can be contacted if required.
In the owner object, the fields username and email are required. You can however add more information in this object if you need.
{
"owner": {
"username": "github-username",
"email": "any@email"
},
}Describe your domain name and your usage. This is purely for documentation purpose and is optional.
This is a link to your website repository or your github account. This is purely for documentation purpose and is optional.
This is where you specify how you want to link to your server/webpage.
Currently, only CNAME, ALIAS, A, URL record types are supported.
Here's a few different use cases for the given record types -
- CNAME/ALIAS Replace CNAME with ALIAS for alias record type
{
"record": {
"CNAME": "username.github.io"
}
}- A record
{
"record": {
"A": [
"999.999.991.999",
"999.999.992.999",
"999.999.993.999",
"999.999.994.999"
]
}
}- URL redirection
{
"record": {
"URL": "https://my-other-website.com"
}
}- Force HTTPS on your CNAME (or ALIAS or A) record
{
"record": {
"CNAME": "username.github.io",
"URL": "https://your-domain.is-a.dev"
}
}