As a frontend developer, you don't really want to worry too much about DNS. However, it can be frustrating when DNS records block you from doing your work. Read on to learn some basic troubleshooting steps for your DNS records.
Apex Domain and A Records
An apex domain is your root domain without any subdomains, like
vercel.com. Notice that there is no
www prefix. If you'd like to have your apex domain hosted on Vercel, make sure that you have a single A Record with the value of
220.127.116.11 (Vercel's Anycast IP Address).
If you have multiple A Records set for your domain, conflicts can arise because different regions will resolve to different addresses. To confirm that the record is set correctly, you can run the following command in your terminal:
1dig vercel.com +short
If your A Record is configured correctly, you will have a single IP address appear (
18.104.22.168). If you see nothing or more than one IP, double check your DNS record to make sure it is set correctly.
Subdomains and CNAME Records
When you want to set up a subdomain like
api.vercel.com, you need to configure a CNAME Record. The Name field of your CNAME record should be set to the name of your subdomain without including the apex domain. Continuing with our example, the Name field for
api.vercel.com would be
api - not
api.vercel.com. The Value field should be set to
You can see if your DNS record was set correctly by running the following command in your terminal:
1dig cname api.vercel.com +short
Mail and MX Records
When you want to use a custom domain for sending and recieiving email, you need to set MX Records with values for your mail provider. If you are using GSuite from Google for example, you can find the list of the required MX records here.
NOTE: You can use MX presets provided by the Vercel DNS editor to save some time.
The Name field should be blank or set to the at (
@) symbol, but the Value and Priority fields should be set as instructed by your mail provider.
You can see which MX Records are set for your domain by running the following command in your terminal:
1dig mx vercel.com +short
It's important to keep in mind that DNS is a distributed system coordinated by many parties all across the world. A certain region may resolve a DNS record with one value and another region may resolve it as another. DNS changes can take some some time to propagate everywhere consistently.If you want to get a clear view of how the world sees your domain, you can use a tool like WhatsMyDNS? to get the full picture for each of your DNS records.