Support Forums

[Support Guide] How to use Netlify’s branch deploy feature without Netlify DNS

Last checked by Netlify Support Team on September 19, 2021

So - you’ve discovered the concept of branch subdomains and want to use them! But you can’t use Netlify’s DNS Hosting? Never fear, there is a way to do this and this post will explain how in detail!

Please note, however, that going this route means missing out on single click setup and all the goodness it includes - for example, getting an SSL certificate configured automatically. If you are okay with this downside, or simply cannot use Nelify DNS for some reason, here’s how to do it!

1. Successfully Deploy the Branch to Netlify.

First, please make certain the branch has deployed successfully - meaning both the build and deploy must happen successfully, on Netlify.

If branch deploys are disabled or if the build/deploy processes are failing, then please resolve those issues before proceeding. If you run into any issues the following documentation may be helpful:

You might ask: Why do I need to deploy before configuring DNS in step two?

The answer is that the branch DNS record needs to exist with us here at Netlify first. This is simply because it will need to be entered with the third-party DNS provider in step two.

2. Create the DNS record with your current DNS provider.

Next, you’ll need to create a DNS record at your DNS provider pointing to the branch DNS record at Netlify.

There are two important considerations:

  1. the subdomain must match the branch name (“slugified” as needed)
  2. the subdomain will be under the primary custom domain

This second point means that if your primary custom domain is www.example.com then the subdomain will be branch-name.www.example.com and not branch-name.example.com.

Here is an example scenario:

  • the custom domain is www.example.com
  • the branch name is branch-name
  • the branch should be served at https://branch-name.www.example.com/
  • the TTL value (time to live value - more below) will be 3600 seconds which is one hour
  • the sub-domain at Netlify is happy-scientist-123456 (meaning the Netlify URL for the master branch is https://happy-scientist-123456.netlify.app/)

With the values above defined for this example, the DNS record you create would look like so:

branch-name.www 3600 IN CNAME branch-name--happy-scientist-123456.netlify.app.

The format above is required and no other naming conventions will work. The key points for the DNS record are:

  • There should be two dashes between branch-name and happy-scientist-123456.
  • The record should be the type CNAME.
  • The branch name must match the sub-domain you want exactly. If your branch is called staging your sub-domain cannot be stage.www.example.com. It must be staging.www.example.com.

3. Confirm the new URL is working and, if so, contact support for SSL provisioning.

Yay! We’re done. Well, almost.

I did mention something before about missing out on “getting an SSL certificate configured automatically”.

Not to worry. Our technical support will be able to assist with that, but, before support can provision an updated SSL certificate, we need to confirm the domain name is working. (If it isn’t working the provisioning will fail so this must be completed first.)

So, how do you test if the DNS record is working correctly?

Well, if you are comfortable working in a terminal (aka, command line, shell, etc) the nslookup command (or dig) can confirm the DNS record is working correctly. Using this imaginary example above (with the branch server at branch-name.www.example.com), the output of nslookup would look similar to this:

$ nslookup branch-name.www.example.com

Non-authoritative answer:
branch-name.www.example.com	canonical name = branch-name--happy-scientist-123456.netlify.com.
Name:	branch-name--happy-scientist-123456.netlify.com

Wonderful! We needed to confirm that branch-name.www.example.com points to branch-name--happy-scientist-123456.netlify.com and it does!

And remember that pesky TTL (time to live) value I mentioned previously? Here is why it matters.

DNS is recursive, meaning that if one DNS server doesn’t know an answer it asks others in a hierarchy. To prevent heavy traffic on the DNS servers at the top of the hierarchy caching is used. Instead of asking for the same DNS record over and over each time you visit the same domain name, both web browsers and intermediary DNS servers will cache the value for a certain time - the TTL value. The TTL value is the time (in seconds) that the record can/should be cached.

This matters because, if you are changing an existing record for domain (or, like me, you sometimes make a mistake when configuring your DNS records), we must wait for the old/incorrect DNS record to timeout before the new one will take effect.

On the other hand, if this is a new DNS record (meaning it is a newly added sub-domain which didn’t already exist) the TTL value won’t affect anything. This is because a new record, by definition, isn’t cached anywhere.

4. Contact Netlify Technical Support to get the SSL certificate extended to the new sub-domain.

If the nslookup test above succeeded, then the last step is to please contact our Technical Support team asking for the the SSL certificate to include the new branch sub-domain. You can do this by making a new topic in the forums #Netlify-support category (or if you have a Pro plan or above, using our support form.)

This is the reason we ask you to confirm the new DNS record is pointing to the branch in step three. We cannot extend an SSL certificate to cover the new sub-domain until there is a DNS record pointing to Netlify.

Once the DNS record is configured, we will be happy to extend the SSL certificate to include the newly added branch sub-domain.

If there are questions about this, please let us know.

Custom subdomain for branch deploy
Creating a subdomain using Netlify DNS
Branch Subdomain and SSL Certificate
Configuring branch subdomain names
Adding new custom branch domain to SSL Certificate
Subdomain SSL Extension for Branch Deploy
How to set up a staging site
Branch Deploys & Branch Subdomains on Custom Domain - nslookup fails "server can't find..."
Branch Deploy SSL certificate extension
Issue with staging subdomain propogating SSL
Enabling SSL on Subdomains
Could you activate the https on my staging domain?
Certificate request
Branch Subdomain and SSL Certificate
SSL Certificate extended to branch subdomain
Subdomain SSL for branch deploy
Request to extend SSL to new sub-domain
404 Not Found error when accessing branch via CNAME
Deploy a second branch
Branch Deploy DNS
SSL certificate for branch deployment
Enable SSL certificate for branch subdomain
Include new branch sub-domain to my ssl certificate
Need ssl certificate for branch deploys (CNAME record ready on aws route 53)
Added a domain and it is still not verified
SSL certificate change for branch deploy
Enable branch subdomains
Branch deploy without DNS
I'm having issues deploying a branch to a subdomain
Let's Encrypt certificate doesn't include branch subdomains after changing the primary domain
Extend certificate - branch deployments on our own domain
SSL not working for brach deploy subdomain
We need to enable *.sta91ng.freshping.io for https://app-freshping-staging.netlify.com
Subdomaine for branch
Wildcard SSL certificate for subdomains (branch subdomains)
Set up SSL for my branch deploy please!
Request to extend SSL cert to subdomain
Certificate using lets encrypt is not getting renewed
Extend External DNS Branch Subdomain SSL
Let's Encrypt certificate doesn't include branch subdomains after changing the primary domain
Help with SSL for Branch Deploy
Branch Subdomain SSL Request
Is there a way to change the URL of deploy-preview?
[Support Guide] DNS Quick Start - How to set up DNS
Deploying site on branch without build command
Let's Encrypt certificate doesn't include branch subdomains after changing the primary domain
Branch Subdomain and SSL Certificate
SSL on <branch>.<subdomain>.domain.dev
Extend SSL certificate to branch subdomain
Assistance setting up SSL for branch deploy
Extend SSL certificate to branch subdomain - new
SSL Certs for custom subdomain
Preview Builds on Custom Domains
SSL certificate for branch deploy
Enabling branch deploys for a site that doesn't use netlify DNS
NetlifyDNS - branch subdomain cert error
Branch deploys not working when _not_ using Netlify DNS
Branch Deploy Periodically Failing [Likely Due to SSL Errors]
Custom subdomain not resolving on branch deploy
SSL Cert for branch deployment
Https certificate installation for subdomain
Branch Subdomains not working correctly
Enable branch subdomains
Branch Deploy SSL Certificate
SSL certificate for Branch subdomain - 2473e964.netlify.app
Provision SSL certification in anticipation of Netlify Transition
Can you deploy existing build to another site?
SSL Let's Encrypt subdomain issue
Branch Domain SSL for Akita Software Staging
Branch Domain SSL for Akita Software Staging
SSL certificate to include the new branch sub-domain for develop
SSL not deploying for branch subdomain
Issues with DNS settings from custom domain
Point branch deploy to subdomain on Route53
Point branch deploy to subdomain on Route53
Subdomains with www on netlify - how to set up?
Subdomains with www on netlify - how to set up?
I need to get SSL certs for our stanging branches
Extend SSL certificate for subdomain
Request for SSL Certificate extension for branch deploy for non-netlify managed DNS subdomain
Certificate extension request
Request for SSL Certificate extension for branch deploy for non-netlify managed DNS subdomain
Branch Deploy SSL Cert
Request for SSL certificate for non-Netlify DNS branch deploy
Add subdomain to SSL Cert
Setting up SSL for branch deploys
Subdomain Certificate Request
Ssl for branch domain with 3rd party DNS provider
SSL Certificate extension for 2 sites
SSL certificate extended to new sub-domain
SSL extension please
Requesting help with Branch Subdomain
SSL Request for branch subdomain
[Support Guide] How to detect and fix inactive Netlify DNS zones
Transfer Domain from Netlify to Cloudflare
Requesting help with Branch Subdomain
SSL certificate for branches
Sub domain created by netlify dns not working i get DNS_PROBE_FINISHED_NXDOMAIN error
Branch Subdomain SSL/TLS certificate extension
SSL certificate to include the new branch sub-domain
Branch subdomains, enable SSL
Please include subdomain (external DNS) in SSL certificate
SSL certificate for branches
Custom SSL request for branch Deploy
Request for SSL cert on branch subdomain
Cloudflare DNS configuration for Subdomains + Branch Domains
Get SSL certificate extended to the new branch deploy sub-domain
Possile add same 404 error page for every subdomains?
Extend SSL certificate to custom branch subdomain
Update SSL Cert with new subdomain
Cloudflare DNS configuration for Subdomains + Branch Domains
Is it possible to use SSL certificates with branch deploys, without Netlify DNS, while on the free plan?
Request: extending SSL certificate to subdomain
Sub domain SSL Request
Extend SSL certificate to include branch sub-domain
Branch feature SSL
SSL Certificate need for sub domain
Subdomain SSL Extension for Branch Deploy
Enabling SSL on Subdomains
SSL certificate extension to the new sub-domain
Extend SSL certificate to sub-domain
Need a branch subdomain added to a project's SSL certificate
Using one domain per branch
Netlify, Branches & Bitbucket