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?

Here’s the outline of what you will learn. If you have any trouble, tweet me @yoginths or shoot me an email. I’ll respond (although maybe not instantaneously) and we’ll get you up and running.

  1. Create a GitHub Pages site for your username
  2. Use CloudFlare DNS
  3. Set up a custom domain
  4. 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

create a new repo

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 repo

create an index file

4. Fire up your favorite browser to: 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 repo

This should be your custom domain. Mine is


Now we will move onto CloudFlare to configure our supercharged DNS! If you have any questions contact me here and here. Let’s go!

Supercharging with CloudFlare

You know the routine! Sign up here and read more about CloudFlare here. CloudFlare “protects and accelerates any website online.” Plus its free, quality DNS for your new GitHub Pages site!

1. Add a your custom domain

custom domain

2. Create a CNAME record pointing to your site

create a cname

3. Your result should look something like this

(where yoginth == your username). If it does not, add the records so they match what you see.

dns settings

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:

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!

Wrapping Up

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 repo to see GitHub Pages in action.