Github pages custom domain with OVHcloud

Rayan Khalil Sebbar
3 min readJan 14, 2024

--

This article to describe how to configure a custom domain name (from OVHcloud) for a website hosted on Github Pages.

📝 Requirements

  • a domain with OVHcloud (it works also with others domain names registrar like Google Domains, Namecheap etc.)
  • a Github account, a repo for your website and Github pages activated in your repo settings

⭐Step 1 — Set domain in GitHub project

  1. On your GitHub Pages repository settings. add your custom domain then click ‘Save’.

Notes:

a) You should get a ‘DNS check unsuccessful’ error and this is expected as you did not yet set your DNS records from your DNS provider.

b) This action of setting ‘custom domain’ will create a file namedCNAMEfile in your repo, don’t modify it and don’t delete it.

⭐Step 2— Set your DNS records

We are going to addA & CNAME records in our domain registrar.

  1. Go to your domain name registrar (here I’m using OVHcloud)

2. For OVHcloud, firstly delete default pre-configured CNAME records for your www subdomain (otherwise you won’t be able to add a new CNAME record for www domain). You can do this by selecting the default www record then clicking on ‘Delete’.

3. Click on ‘Add an entry’ then select CNAME:

4. Configure CNAME record for www subdomain to target your username.github.io url then click on ‘Next’ and ‘Confirm’

5. Now repeat the same action for your four A records (185.199.108.153, 185.199.109.153, 185.199.110.153 and 185.199.111.153):

6. Finally, your DNS records should look like this:

DNS records (1st page)
DNS records (2nd page)

⭐Step 3— Wait then configure ‘Enforce HTTPS’

After waiting some time (on my side 30min), DNS check should be successful from Github Pages and your site should be available at yourdomain.fr and also www.yourdomain.fr

Don’t forget to activate ‘Enforce HTTPS’ option as it will to serve your site over HTTPS enhancing security and availability.

Thanks for reading! Please share and recommend to other interested readers!

Don’t hesitate to reach out if you have any questions around this!

--

--

Responses (1)