To set up a www subdomain, such as you must configure a CNAME record with your DNS provider.

Tip: If you have trouble configuring your CNAME record, then contact your DNS provider for help. They can help confirm that you have configured your custom domain correctly with their services.

Warning: We highly recommend adding your custom domain to your GitHub Pages site's repository before configuring your domain name with your DNS provider. For more information, see "Adding or removing a custom domain for your GitHub Pages site."

For more information on www subdomains, see "About supported custom domains."

Configuring a CNAME record with your DNS provider

  1. Confirm that you have added a custom domain to your GitHub Pages site.

  2. Contact your DNS provider for detailed instructions on how to set up the subdomain you added to your repository's CNAME file.

  3. Follow your DNS provider's instructions to create a CNAME record that points to your default pages domain, such as to your subdomain. Your DNS changes can take over a full day to update and the wait varies among DNS and hosting providers.

    Danger: Do not use wildcard DNS records (e.g. * with GitHub Pages! A wildcard DNS record will allow anyone to host a GitHub Pages site at one of your subdomains.

    Note: Your default GitHub Pages domain is determined by the type of pages site you have. For examples, see this domain chart.

  4. To confirm that your DNS record is set up correctly, use the dig command with your custom domain. Using a custom domain as an example:

    dig +nostats +nocomments +nocmd
    ;                     IN      A              3592    IN      CNAME      43192   IN      CNAME   < GITHUB-PAGES-SERVER >.
    < GITHUB-PAGES-SERVER >.      22      IN      A       199.27.XX.XXX

Further reading