By default, all deployments are assigned a .now.sh suffixed domain.
This domain can be replaced with a Custom Domain of your choice. This Custom Domain can be purchased with ZEIT or a third-party.
In this document, adding a domain to your ZEIT Now projects is explained in detail.
Adding a Domain
If you don't own a domain yet, you can purchase it with ZEIT. Then, once you own a domain, adding it to a project is very straightforward:
Step 1: Selecting Your Project
On the dashboard, pick the project to which you would like to assign your domain:
Selecting the project from the ZEIT Dashboard.
Step 2: Navigating to Domain Settings
Once you have selected the project of your choice, click on the Settings tab:
Selecting the Settings tab from the Project Overview page.
Then, select the Domains menu item:
Selecting the Domains menu item from the Project Settings page.
Step 3: Entering Your Chosen Domain
From the Domains page, enter the domain you wish to add to the project:
Entering a domain for the project from the Domains page.
Step 4: Configuring the Domain
Once the domain has been added, you will be presented with different methods for configuring it, depending on whether it is an apex domain (zeit.co) or subdomain (docs.zeit.co).
Both domain types can be configured using the Nameservers method. However, apex domains also allow for verification via the ANAME record, while subdomains allow for verification via the CNAME record.
Apex Domains
You can configure apex domains either through the Nameservers or ANAME methods.
Instructions on configuring an apex domain from the Project Domains page.
Subdomains
You can configure subdomains either through the Nameservers or CNAME methods.
Instructions on configuring a subdomain from the Project Domains page.
Step 5: Domain Configured
Once the domain has been configured, the card status will change to reflect this.
A configured domain on the Project Domains page.
Wildcard Domains
You can use your custom domain as a Wildcard Domain by prefixing it with *..
To add a Wildcard Domain, follow the steps to add a domain, the only change being; at step 3, where you should instead use the prefix mentioned above, for example; *.acme.com.
A Wildcard Domain awaiting verification.
After the verification process is complete, the status of the domain will be updated within the UI to confirm that it is ready for use.
Deploying with Your Domain
Once the domain has been added to your project and configured, it is automatically applied to your latest deployment.
When a custom domain is assigned to a project with an enabled ZEIT Now for Git Integration, each push (including merges) to the default branch (commonly master) will trigger a deployment to the defined domain.
Reverts take effect immediately, assigning the custom domain to the deployment made prior to the point the revert is effective from.
Redirecting Domains
You can add domain redirects from the Domains tab when more than one domain is present for the project. This provides a way to, for example, redirect a www subdomain to an apex domain but can be used in a variety of ways.
To add a redirect, click the Edit button for the domain you want to redirect from and use the Redirect to dropdown to select the domain you want to redirect to:
A domain redirect that redirects requests made to www.zeit.rocks to zeit.rocks.
Moving Domains
You can move domains to another profile or team using the Domains tab from the ZEIT Dashboard.
Selecting the Domains tab from the ZEIT Dashboard page.
Once on the Domains tab, select the domain(s) you wish to move by using the checkbox next to each domain then click Move.
Selecting which domains to move from the Domains tab.
After selecting the domain(s) and clicking Move, you will be asked to confirm which profile or team you wish to move them to.
Entering a new profile or team destination for a domain.
When selecting the input field, you will be provided with a list of teams you belong to. If the profile or team you wish to move the domain(s) to is not present, enter the slug value instead. You can find the slug value in Settings page for both profiles and teams.
To confirm the change, select Move. The domains will be transferred to the new profile of team immediately.
Assigning a Domain to a Git Branch
Every commit pushed to the default branch of your Git repository using our Git Integration will be assigned the Domains configured in your project.
In order to automatically assign a Domain to a different branch, you can select it in the Git Branch dropdown of your Domain:
A Domain that is automatically assigned to the staging Git Branch.
Removing a Domain
To remove a domain that is assigned to a project, navigate to the Domains tab from the Project Overview and click the Edit button for the domain you want to remove:
A configured domain on the Project Domains page with the option to edit.
Once the Edit button has been clicked, you will be presented with further options. Click the Remove button to remove the domain from the project:
A configured domain on the Project Domains page with the option to remove.
Provider Specific Instructions
Cloudflare
To use Cloudflare-managed domains, follow these steps:
- Configure your domain such that SSL is disabled for the path
/.well-known/**. - Run
curl http://<domain>/.well-known/acme-challenge(Replace<domain>with your domain. Notice that it’shttpand nothttps).
If the above curl command returns an error (e.g. {"error":{...}}), then you’re good to go - it means that ZEIT can generate certificates successfully. Otherwise, make sure that SSL is disabled for /.well-known/** and try again.
Related
For more information on what to do next, we recommend the following article: