01
What is a domain?
A domain is a name people enter in their browsers to reach a website.
Here’s an example:
A recognisable name is easier to remember than a technical address.
02
Domains and hosting
Each plays a different role in getting your website online.
Domain — the address visitors use to find your website.
Hosting — the service that stores and serves your website files.
If you publish with GitHub Pages, GitHub can serve those files for you.
03
What is DNS?
DNS stands for Domain Name System.
DNS records help direct traffic for a domain to the appropriate service.
Here’s a simple way to picture it:
↓
DNS
↓
server or hosting service
04
The root domain and www
These addresses are related and may use different DNS records.
www.example.com
The first is called the root domain or apex domain.
www is a subdomain.
05
Add your domain in GitHub Pages
If you use GitHub Pages, add the custom domain in the repository settings before directing DNS traffic to GitHub.
Open your project repository.
Go to Settings.
Open Pages.
Find Custom domain.
Enter the domain you want to use and save it.
Once you configure the DNS records, GitHub can check them.
06
Configure the DNS records
Open the DNS settings at the provider that manages your domain.
The records you need depend on whether you’re connecting the root domain or a subdomain such as www.
07
What is a CNAME record?
A CNAME record lets one name, such as a subdomain, point to another domain name.
For a GitHub Pages site, you might point:
to an address like:
The exact destination depends on the account or organisation hosting the site.
08
DNS changes can take time
After you update a record, the change may take time to appear everywhere.
This is commonly called DNS propagation.
09
Enable HTTPS
HTTPS encrypts the connection between the browser and the website.
After GitHub Pages checks the domain and HTTPS is available, look for Enforce HTTPS in Pages settings.
Your site should use an address such as:
rather than the unencrypted HTTP address:
10
Check the versions of your address
When setup is complete, test the addresses that apply to your configuration.
https://www.example.com
Make sure each one takes visitors to the primary address you set up.
11
Common mistakes
Misspelling the domain name.
Using the wrong DNS record.
Leaving conflicting or duplicate records in place.
Testing before DNS changes have propagated.
Forgetting to test HTTPS.
12
Check what each record does before changing it
Your DNS panel may contain records for other services.
For example, some records may be used for your domain’s email.
SUMMARY
What you’ve learned
- What a domain is.
- The difference between a domain and hosting.
- What DNS does.
- The difference between the root domain and www.
- Where to set up a domain in GitHub Pages.
- What a CNAME record does.
- Why DNS changes can take time.
- Why HTTPS matters.
- Why to test each version of your domain.
- Why to review DNS records before removing them.
PUT IT INTO PRACTICE
Plan your domain connection
Walk through the setup so you know what to do when you’re ready to connect a domain.
- Identify where your website is hosted.
- Identify where you’d manage your domain.
- Find your provider’s DNS settings.
- Find Settings → Pages in GitHub.
- Locate the Custom domain field.
- Read the current GitHub Pages documentation on custom domains.
- Check how to enable HTTPS.