Custom Domains with Github Pages, CloudFlare
People pay a lot of money to web hosts and DNS Providers.
Instead of spending another cent on your web hosting company of choice, why not make the switch to Github Pages and CloudFlare? You can host
n number of static web pages for free WITH your custom domain name.
Yes. It costs only $00.00 per year.
Tell me more, you might say.
To which I reply: “Read onward my friend!”
What will I learn?
- Create a GitHub Pages site for your username
- Use CloudFlare DNS
- Set up a custom domain
- Drop your current web host & save money
Alright, let’s get started!
Configuring Github Pages
Maybe you have never heard of GitHub or are not familiar with GitHub Pages. No problem—you can create an account here and read more about GitHub here. GitHub Pages are public webpages freely hosted and easily published through GitHub. Start building your personal site below.
1. Create a new repository named
2. Clone the repository in terminal, GitHub for Windows, or GitHub for Mac.
(If you know about this great! Otherwise, feel free to move on to step 2.)
3. Create (& commit) an index.html file in your username.github.io repo
4. Fire up your favorite browser to: username.github.io and see the results!
Now that you are getting a hang of GitHub Pages, we’ll add your custom domain name to your site.
5. Add a CNAME file to your username.github.io repo
This should be your custom domain. Mine is
Supercharging with CloudFlare
1. Add a your custom domain
2. Create a
CNAME record pointing to your
3. Your result should look something like this
yoginth == your username). If it does not, add the records so they match what you see.
4. FINALLY, you’ll want to transfer your DNS to CloudFlare.
I use Freenom as my domain name registrar so you’ll want to do the same thing for yours. Go to the “Transfer DNS” option of your registrar’s site and replace the DNS Servers with the ones from CloudFlare.
Your name servers should look similar: name.ns.cloudflare.com
5. Wait for the changes to propagate.
Your custom domain should now direct to your GitHub Pages site! Free web hosting, only pay for your domain!
That just about does it. Hope you were able to learn something new or at least save a few bucks. Contact me if you need help or have questions. Check out my yoginth.github.io repo to see GitHub Pages in action.