Lesson 1: Using A Custom Domain
Overview
In this lesson, we will explore how to personalize your GitHub Pages website by changing its domain name. Whether you’re looking to align your site with a personal brand or make it more memorable, a custom domain can set your project apart. We’ll cover how to modify your site’s default GitHub domain and guide you through the process of setting up a custom domain from an external provider.
Learning Objectives
Students will be able to change the default GitHub Pages domain to a more personalized one within GitHub settings.
Students will be able to acquire and configure a custom domain from an external domain registrar for their GitHub Pages site.
Lesson
Creating the default Github Pages Domain:
To create a default github pages domain;
You have to go to your github profile.
Create a repository with the name in this format [your profile name].github.io. i.e, if your profile name is “james” your default github domain name will be james.github.io.
Acquiring and Setting Up a Custom Domain:
Choose a domain registrar to acquire a free or paid custom domain (e.g., Freenom for free domains). Once you have your domain, you can follow the step listed below on Changing the Default Github Pages Domain to configure it.
You can lookup the github domain documentation for more details on how to setup custom domain. custom domain
Changing the Default GitHub Pages Domain:
When you navigate to the reporsitory you just created to host your website, Navigate to the Settings
Then find the ‘Pages’ section on the left sidebar. as annotated in the image below.
In the ‘Custom domain’ section, you can input your personalized site’s URL in the text box provided. For this lesson, I will be making use of africancompute.com as my personalized domain name.
As a heads up, Github has to run a DNS check on the url. This is a security measure which takes at most 48 hours before being approved. So do not panic when it takes longer than you anticipated.
When DNS check is successful
This is what you get when DNS check is successful.
After a successful DNS check as denoted by 1 in the image below, you can navigate to the website by clicking on view site as annotated. |
After a successful DNS check and viewing the url link, the image below will be the final result.
You can see the custom domain name africancompute.com in the url bar above.
Practice Activity
Acquire a custom domain with your name from an external registrar e.g. mfonekpo.com.
Configure it for your GitHub Pages site.
Change your GitHub Pages site to a more personalized GitHub domain.
Share a link to your website in your group channel.
Note - Share any challenges you might be having there too.
Conclusion
You should now have a GitHub Pages site with a personalized domain, enhancing its professional appearance and memorability. In our next lesson, we will delve into optimizing your site’s SEO to increase visibility and traffic.
FAQ
- Can I use any domain registrar for a custom GitHub Pages domain?
Ans: Yes, you can use any domain registrar to acquire a custom domain for your GitHub Pages site. The key is to correctly configure the DNS settings to point to GitHub’s servers.
- What if my custom domain isn’t working immediately?
Ans: Changes can take up to 48 hours to propagate. If your custom domain isn’t working right away, give it some time. Ensure your DNS settings are correctly configured according to GitHub’s documentation.