Overview

You can use your own domain for a Netlify site for free.

A domain name is the URL or web address where visitors find your site.

By default, any site on Netlify is accessible via its Netlify subdomain, which has the form [name-of-your-site].netlify.com. For example, you would access a site named warrior-priscilla-50207 with warrior-priscilla-50207.netlify.com.

To make a site accessible via one or more non-Netlify domain names (eg. www.yourcustomdomain.com), you must add custom domain(s) to your site as described below.

General steps:

If you don‘t already own a custom domain, buy one with a domain registration service.

Test that your site is accessible via the custom domain. There may be a delay while DNS changes propagate.

Definitions

Domain name (or domain for short): full name used to access a site. For example, yoursitename.netlify.com or www.yourcustomdomain.com

Root domain (also known as naked, bare, or apex domain): the yourcustomdomain.com part in www.yourcustomdomain.com.

Subdomain: a domain that is part of a larger domain; the only domain that is not also a subdomain is the root domain. For example, www.yourcustomdomain.com and app.yourcustomdomain.com are subdomains of yourcustomdomain.com.

Netlify subdomain: Netlify term for the default domain with the form [name-of-your-site].netlify.com given to each site.

Custom domain: a non-Netlify domain assigned to a site.

Primary domain: Netlify term for the main custom domain assigned to a site.

Domain alias: Netlify term for additional custom domains assigned to a site.

Assigning a non-www subdomain

If you set a subdomain other than www as your primary domain (eg. app.yourcustomdomain.com), only one entry will be added to the list of custom domains assigned to your site.

DNS configuration

After you add a custom domain to a site, the domain name will normally appear grayed out in the Custom domains panel, with a Check DNS configuration link next to it. This means Netlify cannot serve your site correctly under that domain.

To serve your site under a custom domain, you need to point DNS records for the domain at the Netlify servers.

Click Check DNS configuration next to the custom domain to see customized instructions on the DNS records you need to configure. The instructions will vary depending on whether:

Depending on your DNS provider, changes to DNS records can take several hours to propagate and take effect for the entire internet.

Automatic DNS configuration

Netlify offers the option to handle DNS management for you. This enables advanced subdomain automation and deployment features, and ensures that your site uses our CDN for the root domain as well as for subdomains like www.

After adding a custom domain to your site in the Custom domains panel, click the options button represented with a … icon next to your primary domain, and select Set up Netlify DNS in the dropdown. This will open a 3-step flow to move your DNS traffic to Netlify:

Step 1. Confirm that you want to add your domain to Netlify by creating a DNS zone for the domain – the DNS zone will contain all of the DNS records for that domain. This step won’t change how we serve your site. Your DNS traffic will only be served by Netlify once you complete all 3 steps.

Step 2. Netlify will create the DNS records required for your Netlify site automatically. We are happy to support DNS for all records in your domain including ones that don’t point to our service; if you’re using your domain for other services, like email, you will need to add all other records like MX, etc, in this step. (And, if you need SRV records here - please contact support to get them installed)

Step 3. Make note of the four nameservers assigned to your new DNS zone – they may vary for every DNS zone you create. Go to your domain registrar and change your nameservers to point at your new Netlify DNS zone.

It can take some time for the nameserver change to propagate, but once this is done you’re all set.

Manual DNS configuration for root and www custom domains

If you’re not using Netlify’s managed DNS, you’ll have to manually configure the DNS records for your domain with your existing DNS provider.

If you set a root domain, like yourcustomdomain.com, or a www subdomain, like www.yourcustomdomain.com, as your custom domain, you’ll want to set up two records at your DNS provider –one for the root domain, and one for the www subdomain– so that people who type either one in can end up at your website, and so that our automatic domain redirects work.

For instance, if my domain is mycustomdomain.com and my Netlify sitename is mysitename, I would create a CNAME record for www pointing www.mycustomdomain.com to mysitename.netlify.com.

To point the root domain at our servers, there are two options:

Recommended: Use a DNS provider that supports CNAME flattening, ANAME or ALIAS records for root domains, and alias your root domain to [your-site-name].netlify.com. We recommend using NS1, or Netlify’s built-in DNS for this purpose.

The screenshot below shows an example of Godaddy’s DNS record panel with the DNS records required to point a custom domain at a site called mysitename.

Manual DNS configuration for non-www custom domains

If you are planning to set your site’s custom domain to a non-www subdomain, like blog.yourdomain.com, most of the above instructions won’t be as applicable to you. The things to make sure of are:

You should use a CNAME DNS record for that subdomain to point to your [your-site-name].netlify.com so you can use the CDN.

You don’t need a www.subdomain.yourdomain.com DNS entry.

You probably want to stick with your external DNS host. If you use Netlify DNS, you’ll be hosting yourdomain.com with us, not subdomain.yourdomain.com. Netlify DNS can only manage entire DNS zones for root domains.

Branch Subdomains

Netlify DNS can automatically turn your deployed branches into their own subdomains.

For example: If you have a branch named staging, and your site’s custom domain is example.com, you can view it at staging.example.com. Use the New subdomain button to select a branch and create a subdomain for that branch.

A subdomain can be deleted by clicking the x button in the corresponding subdomain row.

If you need to set up branch subdomains without us managing your DNS, please contact support.

Naked domains?

You can use naked domains with Netlify, but we recommend you always use the www version of the domain (eg. www.example.com) for your site. This makes it easier to take advantage of Netlify’s powerful CDN.

If you prefer the naked domain, we recommend you use a DNS provider that supports CNAME flattening, ANAME or ALIAS records for apex domains such as Cloudflare, NS1, or Netlify’s built-in DNS.

If you instead set an A record for the apex domain, you won’t be able to take advantage of the full Netlify CDN. If your provider lets you set an ALIAS, the full CDN will work. If not, when you serve from your apex domain with an A record, your assets (Javascript, CSS, images) may be served out of a global CDN depending on your deployment settings, but your HTML will be served out of our primary datacenter in the US.

Domain redirects

We’ll automatically set up redirects for the alternative domain to the primary domain. So if you use www.example.com, we’ll configure example.com to do a 301 redirect to the www domain. If you assign the root domain to your site, we’ll redirect in the opposite direction.

We only redirect automatically between the root domain and www. Not any other subdomains. You can configure other hostname redirection yourself as described in this article.

Domain aliases

You can add additional custom domains to your site so the same site will be rendered on several different domains. You can use domain aliases together with rewrite and redirect rules to redirect or rewrite based on the hostname entered into the browser by your visitors.

Notice something is incorrect or outdated?

First off, great eye! We appreciate your discovery and want to ensure it gets addressed immediately. Please let us know here.