# How do I add a custom domain to my Vercel project?

**Author:** Allen Hai

---

Vercel provides all deployments with a `vercel.app` URL, allowing you to generate [Preview Deployments](https://vercel.com/docs/platform/deployments#preview) that can be shared instantly for seamless collaboration.

While you can use any `vercel.app` domain of your choice, we recommend using a [custom domain](https://vercel.com/docs/custom-domains) for any project in production to provide greater personalization and flexibility.

## Adding a Custom Domain

To [add a custom domain](https://vercel.com/docs/concepts/projects/custom-domains#adding-a-domain) to your project, navigate to the **Domains** section under the **Settings** tab for the project, enter the URL for your custom domain and click "Add". It is possible to add both [apex](https://vercel.com/docs/concepts/projects/custom-domains#apex-domains) and subdomains to your project.

Free accounts have a [limit](https://vercel.com/docs/concepts/limits/overview#domains) of 50 custom domains per project.

## Verifying a Custom Domain

Once you have added your Custom Domain, you will need to [verify the domain](https://vercel.com/docs/concepts/projects/custom-domains#step-4:-configuring-the-domain) so it can be used with your [Vercel Project](https://vercel.com/docs/platform/projects). The dashboard will automatically provide further instructions required for verifying your domain.

Dependent on the type of domain added, either apex or subdomain, you will be presented with differing options. Apex domains can be verified by adding an A record with your existing DNS provider while subdomains can be verified by adding a CNAME record.

> **WARNING:** If you are verifying your domain by changing nameservers, you will need to add any DNS records to Vercel that you wish to keep from your previous DNS provider.

## Adding a Domain Redirect

When adding multiple domains to a project, you want to establish the canonical source so that search engines can optimize better for it. It is also a common practice to redirect your apex domain to the **www** subdomain.

You can add a redirect from one to the other by clicking on the "Edit" button for your domain card and selecting an option for the **Redirect to** input field.

## Troubleshooting

- If your domain is not verifying, make sure you do not have conflicting DNS records. For example, if you find that you have multiple **A** records configured for your domain. Remove all of them except for the one that is pointing to Vercel.
  
- If you have added a subdomain to your project, make sure that the correct **CNAME** record is configured with your domain registrar. The name of the record should be the subdomain for your project and the value should be provided by the domain card in your Vercel project settings. The domain should **never** be part of the name field.
  
- If you are getting a 404 error for either your apex or **www** subdomain, make sure you have added both of them to the project as Vercel does not automatically add this for you.
  
- DNS changes can take a while to propagate accross the globe. This may mean that certain regions can access your site as intended, while others wait until the DNS changes have reached them. Please allow some time for these changes to take effect (usually sooner than 48 hours).

---

[View full KB sitemap](/kb/sitemap.md)
