When using a custom domain with Vercel, you are able to manage DNS records for the domain if it is using Vercel's nameservers.
You can create a new DNS record by using the DNS UI. For example, to create a record you would need the following data:
- Name: The prefix or location of the record. For
www.example.com
, the name argument would bewww
. - Type: Types can be A, AAAA, ALIAS, CAA, CNAME, MX, SRV, or TXT.
- Value: The value of the record.
- TTL: Default is 60 seconds. For advanced users, this value can be customized.
- More: Some records will require more data. MX records, for example, will request "priority".
Once DNS records have been changed, you may wish to check that these have been set corretly. There are many third-party tools that do this, such as DNS Checker and DNS Map - these show the state of your DNS records in different regions of the world.
You can also use the terminal to check the DNS record for your domain, examples of doing this for the records above are found below:
dig A api.example.com +short76.76.21.21
dig MX example.com +shortexample-com.mail.protection.outlook.com.
DNS records, with the exception of nameservers, are usually very quick to update, but can take a few minutes in some cases.
If you need to remove DNS records, you can do so once again by using the DNS UI.
Default records can't be removed. However, new records can override them if required.
When working with DNS records, it can be easy to make minor errors in the syntax, these can be difficult to debug. Below is a list of common errors made when adding DNS records and the steps required to resolve them.
To solve this problem, remove the record and add it again without the domain as the "name" argument: