Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub Pages Custom Domain Settings

I'm trying to configure GitHub with my naked domain.com (APEX in GitHub) and www.domain.com.

I have username.github.io working OK.

My A record is pointing to 192.30.252.153 and 192.30.252.154.

I then have two CNAME records set:

  • www.domain.comdomain.com
  • io.domain.comusername.github.io

This configuration, however, is not working.

Accessing domain.com results in a 404 on GitHub. Meanwhile, accessing www.domain.com results in an ERR_NAME_NOT_RESOLVED.

Existing documentation is confusing and there's no clear way of configuring things end-to-end.

Can someone tell me what I'm missing?

like image 786
Gurinder Avatar asked Jun 14 '15 18:06

Gurinder


People also ask

Can you use a custom domain with GitHub Pages?

You can customize the domain name of your GitHub Pages site. GitHub Pages is available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server.

How do I link my domain to my GitHub repository?

On your site's repository, click the settings tab . Under custom domain, type your custom domain and save. GitHub will automatically create a commit with a CNAME file at the root of your repository. Visit the dashboard provided by your domain provider and add a CNAME record pointing to your subdomain.

Is custom domain free in GitHub?

Follow the below steps to publish your own website onto GitHub Pages with a custom domain for absolutely no charges.

How do I add Google domain to GitHub page?

Open up your repository and go to the Settings tab — https://github.com/yourusername/yourrepository/settings — and scroll down to the Github Pages section. In the Custom Domain section here, add in the URL of your newly purchased domain and hit save.


1 Answers

Here's what I've done to get domain.com and www.domain.com working you'll need this:

  1. An A record for www
  2. An A record @ 192.30.252.153
  3. An A record @ 192.30.252.154
  4. A CNAME aliasing www.domain.com to username.github.io. (note the trailing period)
  5. The "CNAME" file in the GitHub Pages repo contains the text "domain.com"

I think the wildcard A record may be optional in your case but I'm not certain.

Edit: Removed wildcard A record. @mheadroom pointed out that GitHub recommends against this entry because it would allow anyone to host a GitHub Pages site on one of your subdomains! https://help.github.com/articles/tips-for-configuring-a-cname-record-with-your-dns-provider/

like image 129
Erik Gillespie Avatar answered Sep 28 '22 08:09

Erik Gillespie