How do I point a subdomain to a service outside of Vercel?

Information on how to make a subdomain available to a service outside of Vercel.
Last updated on March 16, 2023
Domains & DNS

If your domain is managed by Vercel, meaning it is using Vercel nameservers, then you are able to point a subdomain to an external service by adding DNS records with the Vercel CLI.

Locate the value and the name arguments requested by the external provider and use them in the DNS UI, replacing name with the name provided, and 127.0.0.1 with the value:

The DNS UI when adding an A record to api.example.com.
The DNS UI when adding an A record to api.example.com.

Locate the value and the name arguments requested by the external provider and use them in the DNS UI, replacing name with the name provided, and cname.vercel-dns.com with the value:

The DNS UI when adding an CNAME record to example.example.com.
The DNS UI when adding an CNAME record to example.example.com.

Any record, except for nameservers, can be added by using the DNS UI.

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.

Incorrectly adding an A record to a custom domain with a record value of 127.0.0.1.
Incorrectly adding an A record to a custom domain with a record value of 127.0.0.1.

To solve this problem, remove the record and add it again without the domain as the "name" argument:

Correctly adding an A record to a custom domain with a record value of 127.0.0.1.
Correctly adding an A record to a custom domain with a record value of 127.0.0.1.

Couldn't find the guide you need?