In this guide, we will cover how to use your Namecheap registered domain as an alias for your ZEIT Now deployments.
First, you need to add your Namecheap registered domain to your ZEIT account. To get started, use the Now CLI:
The command above adds the domain to your ZEIT account. Once it has been added, the Now CLI outputs some information needed to verify ownership of the domain.
There are two options available for domain verification:
- Verify with Nameservers.
- Verify with TXT record.
Adding a domain with Now CLI.
If you want to opt for verifying your domains with Nameservers, you must use the nameservers listed when you added a domain via the Now CLI. The upside to verifying with Nameservers is that you are verifying and pointing to Now at once.
Use the following command to list the set of nameservers needed for verification:
Inspect a domain with Now CLI.
Now, head over to namecheap.com, log in and click on Domain List.
Namecheap Domains List Page.
Next, click on the Manage button on the domain you want to migrate to Now as indicated by the arrow in the image above.
In the page you are directed to, scroll down to the NAMESERVERS section, click on the dropdown form and select CustomDNS as shown in the illustration below:
Dropdown for selecting the Custom DNS option.
Add the intended nameservers gotten from running the inspect command to the Custom DNS form in the order they are given and save the configuration.
Once Namecheap is done propagating the newly changed DNS for your domain, then your domain is ready to be verified. ZEIT automatically checks the domain for verification. However, if you are keen on manually verifying it, then run the following command:
This option is great if you intend to verify your domain, but not point to Now yet!
In your Namecheap Domain List dashboard, on the domain you want to migrate, click on the Advanced DNS tab. Now, scroll down to the Host Records section, and click on the Add New Record button.
TXT Record as the record type, add
_now as the host, and the value you were given for the record when adding your domain. You can fetch the value again using the
now domains inspect <domain> via the Now CLI.
Adding a TXT record with Namecheap's domain Advanced DNS settings.
Your domain will be verified after adding the TXT record. Once ZEIT verifies your domain, you'll automatically receive an email. You can also manually use the command below to force a domain verification:
Once your domain has been verified on Now, you can configure your domain with DNS records and alias a deployment to it.
Now provides an easy to use command that allows you to add DNS records from the CLI. In this example, you can configure your domain with a set of Gmail MX records via the
now dns add command:
now dns add <domain> @ MX ASPMX.L.GOOGLE.COM 1 now dns add <domain> @ MX ALT1.ASPMX.L.GOOGLE.COM 5 now dns add <domain> @ MX ALT2.ASPMX.L.GOOGLE.COM 5 now dns add <domain> @ MX ALT3.ASPMX.L.GOOGLE.COM 10 now dns add <domain> @ MX ALT4.ASPMX.L.GOOGLE.COM 10
Learn more about using the
now dns command.
If you are new to deploying with Now, follow the Deployment Basics guide to get started.
When your application is ready to be deployed, run the following command:
After deployment, you can now alias your deployment to your domain with the following command:
We highly recommend using the Now for GitHub app coupled with the
alias configuration option which will allow your application to be deployed on push to your GitHub repository and aliased automatically when merged to the main branch.
If you already verified your domain with Nameservers, then this step is done.
The final step of migrating your domain to Now is to point your domain to ZEIT DNS with the intended nameservers set. Using
now domains inspect <domain>, you can always find the intended nameservers to use with your domain.
Once Namecheap's propagation of the updated nameservers is complete, your domain will automatically point to the application you deployed before.
For more information on how you can extend your usage of Now, read the following guides and documentation: