Using a custom domain
You can use your own domain for a Netlify site for free.
While we can host any hostname(s) for you, these instructions are generally tailored to people hosting their main domain/website here in the pattern example.com + www.example.com. If you have other goals, please make sure you read this section at the end of the doc.
Assigning the domain
First, you need to assign the domain to the site you want us to show for that name.
You can do this through the web UI by clicking “Domain settings” when viewing your site dashboard.
You can also assign domains through the CLI tool with the
netlify update command.
We highly recommend setting your custom domain to a www hostname instead of an apex domain (ie. www.example.com instead of example.com). Unless your DNS provider supports ANAME or ALIAS records for the apex domain you won’t be able to take full advantage of our CDN unless you use the www prefix or another subdomain. This article has more details on why we recommend that.
You’ll need to point the DNS records (usually both “www” AND the bare domain) for your domain at our servers.
The recommended way to point your custom domain to our servers is by creating a CNAME record in your DNS configuration. This record will be an alias to your site’s subdomain on Netlify.
For instance, if my domain is
example.com and my netlify sitename is
example, I would create a CNAME record for
Note that no matter which setup you pick for Netlify - you’ll want to set up BOTH records at your DNS provider (bare domain and www), so that people who type either one in can end up at your website, and so that our automatic domain redirects work.
There are two options if you want to serve your website from a naked domain, without the
- Recommended: Use a DNS provider that supports ANAME or ALIAS records for apex domains, and alias your naked domain to
<your-site-name>.netlify.com. We recommend using NS1 for this purpose.
- Alternative: Create an A record pointing your naked domain to our load balancer’s IP:
Depending on your DNS provider, changes to DNS records can take several hours to propagate and take effect for the entire internet.
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 bare domain as well as subdomains like www.
Step 1: After setting up a custom domain on the domain settings page, click the button allowing us to manage your domain needs.
Step 2: Once you have set up a custom domain and enabled Netlify DNS, you need to switch your domain host’s nameservers to our custom NS1 name servers, which we provide in the instructions section of the domain panel. If you don’t see the list at first, you might need to click the ‘show details’ button to show the list.
* Only available with Netlify DNS
The Domain Record form allows you add any standard record type with custom values, TTL, and priority. Remember, it may take up to a few hours for record changes to propagate.
* Only available via our UI with Netlify DNS
Netlify DNS can automatically turn your deployed branches into their own subdomains.
For example: If you have a branch named staging, 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.
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.
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 naked 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.
You can setup domain aliases for your domain, 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.
If you are planning to set your site’s custom domain to a subdomain, like
sub.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
sitename.netlify.comso you can use the CDN.
- You don’t need a
- You probably want to stick with your external DNS host. If you use Netlify DNS, you’ll be hosting
yourdomain.comwith us, not
subdomain.yourdomain.com. Netlify DNS can only manage entire DNS zones for top level domains.
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.