Different DNS Records on Vercel Domains and Add Domain API

I’m using vercel domain’s API to let users add domain on the platform so that the application can load on their domain. The problem is many times the DNS Records response from add-domain API is totally different than what records needs to be added on the domain provider DNS.

Here is the response of add subdomain

And here is what’s being shown on vercel domains

If there is one doc saying how to properly format the records and show it to user than it will be very helpful for everyone implementing domain api.

The domain troubleshooting guide can help with most custom domain configuration issues. You might be able to use that guide to solve it before a human is available to help you. Then you can come back here and share the answer for bonus points.

You can also use v0 to narrow down the possibilities.

While some domains showing DNS like this,

We’re waiting for solution, any idea to streamline this?

Could you share more about how you’re using the API?

Hey @pawlean We’re using API this way,

      const postUrl = `https://api.vercel.com/v10/projects/${this.project}/domains?teamId=${this.team}`;
      const primaryDomain = await axios.post(
        postUrl,
        {
          name: body.redirect,
        },
        {
          headers: {
            Authorization: `Bearer ${this.authToken}`,
          },
        },
      );
      const { data: primaryDomainData } = primaryDomain;
      const secondaryDomain = await axios.post(
        `https://api.vercel.com/v10/projects/${this.project}/domains?teamId=${this.team}`,
        body,
        {
          headers: {
            Authorization: `Bearer ${this.authToken}`,
          },
        },
      );

as we’ve needed where clients are adding www.abcd.com and internally we’re redirecting www.abcd.com to abcd.com.

This API we’re calling for getting domain configuration,

    const { data } = await axios.get(
      `https://vercel.com/api/v6/domains/${domain}/config`,
      {
        headers: {
          Authorization: `Bearer ${this.authToken}`,
        },
      },
    );

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.