How to add a custom domain to Vercel
Are you ready to take your project to the next level and move from a Vercel subdomain (name.vercel.app) to a custom domain address?
In this post, you will learn how to add a custom domain to Vercel, giving your project a unique, secure, and seamless web address.
For this tutorial, I assume that you are already familiar with the platform and have deployed your project. With that clarified, let's get started.
Purchase a Domain
This point may seem obvious, but to have a custom domain on Vercel, you must first register the domain with your preferred platform. So, you need to make a minimal investment; usually, the first year is very affordable, so it's not too much.
Tip on where to buy your domain
Personally, I use DonDominio (don't worry, it's not an affiliate link) because their introductory prices are really good, and they even offer some extensions like .online for just $5.
Prepare your project on Vercel to assign a domain
I bought the domain juneikerc.com that belongs to this same site you are visiting. To add a custom domain to your Vercel project, follow these steps:
1. Select your project.
2. Click on the "Settings" button in the navigation bar.
3. In the sidebar, select the "Domains" option.
4. Enter the domain name and click the Add button. A modal will then appear with some redirection rules; choose your preferred one. In this case, I prefer the second option, redirecting from www. to juneikerc.com.
Set up DNS from your provider to point to Vercel
Next, you should point the domain's DNS to your Vercel project. Follow these steps:
- Log in to the account of the registrar where you purchased the domain.
- Locate the DNS settings for the domain. This is typically found in a section called "DNS," "Manage DNS," or "Domain and DNS."
- You will see a list where you need to find the option to add an A record.
- Assign the newly created record the name @ or the same domain name, with the IP address value provided by Vercel, in this case, it is 76.76.21.21.
Propagation of DNS on Vercel
Now that all the configuration is completed, all that's left is to wait for the DNS to propagate so you can visit the website with your new domain. This process on Vercel, based on my personal experience, shouldn't take more than 5 minutes.