<commit_before>---
layout: post
title: Custom domain with GitHub Pages
summary: Setting up a custom domain with GitHub Pages
---

## Adding a CNAME file to your repository

If you're using a custom domain to redirect your GitHub Pages site, you must create and commit a 
CNAME file to your GitHub Pages repository that contains the custom domain.

[See here](https://help.github.com/articles/adding-a-cname-file-to-your-repository/)

## Configure a CNAME record with your DNS provider

To set up a custom subdomain, you must configure a CNAME record with your DNS provider, 
which may or may not be the same as your web hosting provider.

For more information on custom subdomains, see "About custom domains for GitHub Pages sites."

In cooperation with your DNS provider, create a CNAME record that points from that domain to username.github.io. 
Your DNS changes can take up to a full day to propagate.

To confirm that your CNAME record has been set correctly, use the dig command:

```
dig www.example.com +nostats +nocomments +nocmd
# ;www.example.com.                     IN      A
# www.example.com.              3592    IN      CNAME   username.github.io.
# username.github.io.           43192   IN      CNAME   github.map.fastly.net.
# github.map.fastly.net.        22      IN      A       172.16.58.3
```

[See here](https://help.github.com/articles/tips-for-configuring-a-cname-record-with-your-dns-provider/)<commit_msg>Update 2015-05-06-cname-github-pages.md<commit_after>---
layout: post
title: Custom domain with GitHub Pages
summary: Setting up a custom domain with GitHub Pages
---

## Adding a CNAME file to your repository

If you're using a custom domain to redirect your GitHub Pages site, you must create and commit a 
CNAME file to your GitHub Pages repository that contains the custom domain.

[See Github Help](https://help.github.com/articles/adding-a-cname-file-to-your-repository/)

## Configure a CNAME record with your DNS provider

To set up a custom subdomain, you must configure a CNAME record with your DNS provider, 
which may or may not be the same as your web hosting provider.

For more information on custom subdomains, see "About custom domains for GitHub Pages sites."

In cooperation with your DNS provider, create a CNAME record that points from that domain to username.github.io. 
Your DNS changes can take up to a full day to propagate.

To confirm that your CNAME record has been set correctly, use the dig command:

```
dig www.example.com +nostats +nocomments +nocmd
# ;www.example.com.                     IN      A
# www.example.com.              3592    IN      CNAME   username.github.io.
# username.github.io.           43192   IN      CNAME   github.map.fastly.net.
# github.map.fastly.net.        22      IN      A       172.16.58.3
```

[See Github Help](https://help.github.com/articles/tips-for-configuring-a-cname-record-with-your-dns-provider/)
{'fraction_non_alphanumeric': 0.07851239669421488, 'fraction_numerical': 0.01584022038567493, 'mean_word_length': 3.0459610027855155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2542823', 'n_tokens_mistral': 883, 'n_tokens_neox': 808, 'n_words': 354}