GitHub Pages is one of the easiest and most reliable platforms for hosting static websites, portfolios, documentation, and frontend web applications. Pairing it with a free devs.surf subdomain gives your project a clean, professional address without paying yearly domain registration fees.
In this tutorial, we will configure your GitHub repository and Devs.Surf DNS so your custom subdomain points seamlessly to your GitHub Pages build with automatic Let's Encrypt SSL/TLS encryption.
Prerequisites
- A GitHub repository with GitHub Pages enabled (under Settings → Pages).
- A claimed subdomain on Devs.Surf (e.g.
myproject.devs.surf).
Step 1: Add CNAME in GitHub Repository
There are two ways to tell GitHub Pages which domain to expect:
Method A: Through the Repository Settings
- Navigate to your repository on GitHub.
- Click on Settings → Pages (in the left sidebar).
- Under Custom domain, type your full subdomain:
myproject.devs.surf. - Click Save.
Method B: Via a CNAME File
Create a file named CNAME (all uppercase, no file extension) in the root of your publishing branch (usually main or gh-pages), containing solely your domain name:
myproject.devs.surf
Step 2: Add DNS Records in Devs.Surf
Now open your Devs.Surf Dashboard, locate your claimed domain, and click Manage DNS.
Because GitHub Pages uses CDN edges, you should point a CNAME record directly to GitHub's domain:
| Type | Name / Host | Target / Content | TTL |
|---|---|---|---|
| CNAME | @ |
YOUR-USERNAME.github.io |
3600 |
Note: Replace YOUR-USERNAME with your actual GitHub username or organization name. For example, if your username is johndoe, use johndoe.github.io.
Step 3: Verify and Enforce HTTPS
Once you click Add Record in Devs.Surf, our Anycast DNS immediately pushes the record to authoritative nameservers.
- Return to your GitHub repository under Settings → Pages.
- GitHub will automatically check the DNS record. It will show a checkmark: "DNS check successful".
- Check the box Enforce HTTPS. GitHub will request and install a Let's Encrypt certificate for your subdomain (usually takes 1-5 minutes).
Done! Visit https://myproject.devs.surf in your browser to see your live site with HTTPS secured.