August 15, 2025
2 minutes read
If you own a custom domain, you can serve multiple sites from it — one on the main domain and others on subdomains — using GitHub Pages for free.
In this guide, I’ll show you how did I set up my portfolio on shashank.im and my blog on blog.shashank.im, both hosted on different GitHub repositories.
Wherever I’ve used
shashank.im
orblog.shashank.im
in this guide, replace them with your own custom domain and subdomains.
Subdomains let you keep different projects separated but still under your main brand. For example:
shashank.im → Portfolio
blog.shashank.im → Blog
projects.shashank.im → Side Projects
resume.shashank.im → Interactive Resume
Each subdomain can have its own GitHub Pages site, making it easy to maintain and update independently.
Log into your domain registrar (the place where you bought your domain) and edit the DNS settings.
Add four A
records pointing to GitHub Pages IP addresses:
A @ 185.199.108.153
A @ 185.199.109.153
A @ 185.199.110.153
A @ 185.199.111.153
Add a CNAME record:
CNAME blog <your-github-username>.github.io
Replace <your-github-username>
with your GitHub username.
(Optional) If you want www.shashank.im to work:
CNAME www <your-github-username>.github.io
shashank.im
as the custom domain. shashank.im
Enforce HTTPS
.blog.shashank.im
as the custom domain. blog.shashank.im
Enforce HTTPS
.After DNS changes propagate (usually within an hour but can take up to 24 hours):
Visit shashank.im
→ Portfolio loads.
Visit blog.shashank.im
→ Blog loads.
If you plan to add more:
There’s no strict technical limit to subdomains — you can add as many as your DNS provider allows.
By following this guide, you’ve successfully linked your portfolio and blog under a single domain name, both secured with HTTPS and managed easily through GitHub Pages. Now you can grow your personal brand under one domain, hosting multiple sites for free with GitHub Pages.