Disclaimer: Written by GPT-4

I want to set cusom domain like mgorbatyuk.dev for my website hosted on guthub pages. How can I do it?

To set a custom domain for your GitHub Pages website, you'll need to follow these steps:

  1. Purchase a domain: First, you need to purchase your custom domain (mgorbatyuk.dev in your case) from a domain registrar like Google Domains, Namecheap, or GoDaddy. Follow their process to register your domain.
  2. Update your domain's DNS records: After purchasing the domain, you'll need to update its DNS records. To do this, go to your domain registrar's DNS settings and create two new records:
  3. Wait for DNS propagation: DNS changes may take some time to propagate (up to 24-48 hours in some cases). You can use a tool like https://www.whatsmydns.net/ to check the propagation status.
  4. Configure your GitHub Pages repository: Go to your GitHub repository that's hosting your website, and click on the 'Settings' tab. Scroll down to the 'GitHub Pages' section.
  5. Add your custom domain: In the 'Custom domain' field, enter your purchased domain (e.g., 'mgorbatyuk.dev') and click 'Save'. This will create a CNAME file in your repository if it doesn't already exist.
  6. Enable HTTPS: After the DNS propagation is complete, you should see an option to 'Enforce HTTPS' in the GitHub Pages settings. Enable this to make sure your website is served securely over HTTPS.

That's it! Once these steps are complete, your GitHub Pages website should be accessible via your custom domain. Note that it may take some time for the HTTPS certificate to be issued and the changes to propagate fully.

You said "Create a CNAME record with the 'www' subdomain, pointing to your GitHub Pages repository's default domain (e.g., 'username.github.io')." What www subdomain you mean?

Apologies for the confusion. The 'www' subdomain refers to the most common subdomain used for websites, which stands for 'World Wide Web.' It's often used as a prefix to the main domain name, like www.example.com.

In this context, I'm suggesting you create a CNAME record for the 'www' subdomain to ensure that your website is accessible with both the root domain (e.g., 'mgorbatyuk.dev') and the 'www' subdomain (e.g., 'www.mgorbatyuk.dev').

To do this, create a CNAME record in your domain registrar's DNS settings with the following details:

By creating this CNAME record, you'll be redirecting all traffic from 'www.mgorbatyuk.dev' to your GitHub Pages repository's default domain (e.g., 'username.github.io'), ensuring that users can access your website using either the root domain or the 'www' subdomain.