---
title: "Create a DNS record"
method: POST
path: "/v2/domains/{domain}/records"
tags: ["dns"]
---

# Create a DNS record

`POST /v2/domains/{domain}/records`

Creates a DNS record for a domain.

## Path parameters

- `domain` string, required — The domain used to create the DNS record.

## Query parameters

- `teamId` string
- `slug` string

## Request body

- union
  - object
    - `type` 'A', required — Must be of type `A`.
    - `name` string, required — A subdomain name or an empty string for the root domain.
    - `ttl` number — The TTL value. Must be a number between 60 and 2147483647. Default value is 60.
    - `value` string, ipv4, required — The record value must be a valid IPv4 address.
    - `comment` string — A comment to add context on what this DNS record is for
  - object
    - `type` 'AAAA', required — Must be of type `AAAA`.
    - `name` string, required — A subdomain name or an empty string for the root domain.
    - `ttl` number — The TTL value. Must be a number between 60 and 2147483647. Default value is 60.
    - `value` string, ipv6, required — An AAAA record pointing to an IPv6 address.
    - `comment` string — A comment to add context on what this DNS record is for
  - object
    - `type` 'ALIAS', required — Must be of type `ALIAS`.
    - `name` string, required — A subdomain name or an empty string for the root domain.
    - `ttl` number — The TTL value. Must be a number between 60 and 2147483647. Default value is 60.
    - `value` string, required — An ALIAS virtual record pointing to a hostname resolved to an A record on server side.
    - `comment` string — A comment to add context on what this DNS record is for
  - object
    - `type` 'CAA', required — Must be of type `CAA`.
    - `name` string, required — A subdomain name or an empty string for the root domain.
    - `ttl` number — The TTL value. Must be a number between 60 and 2147483647. Default value is 60.
    - `value` string, required — A CAA record to specify which Certificate Authorities (CAs) are allowed to issue certificates for the domain.
    - `comment` string — A comment to add context on what this DNS record is for
  - object
    - `type` 'CNAME', required — Must be of type `CNAME`.
    - `name` string, required — A subdomain name or an empty string for the root domain.
    - `ttl` number — The TTL value. Must be a number between 60 and 2147483647. Default value is 60.
    - `value` string — A CNAME record mapping to another domain name.
    - `comment` string — A comment to add context on what this DNS record is for
  - object
    - `type` 'MX', required — Must be of type `MX`.
    - `name` string, required — A subdomain name or an empty string for the root domain.
    - `ttl` number — The TTL value. Must be a number between 60 and 2147483647. Default value is 60.
    - `value` string, required — An MX record specifying the mail server responsible for accepting messages on behalf of the domain name.
    - `mxPriority` number, required
    - `comment` string — A comment to add context on what this DNS record is for
  - object
    - `type` 'SRV', required — Must be of type `SRV`.
    - `ttl` number — The TTL value. Must be a number between 60 and 2147483647. Default value is 60.
    - `srv` object, required
      - `priority` number, nullable, required
      - `weight` number, nullable, required
      - `port` number, nullable, required
      - `target` string, required
    - `comment` string — A comment to add context on what this DNS record is for
  - object
    - `type` 'TXT', required — Must be of type `TXT`.
    - `ttl` number — The TTL value. Must be a number between 60 and 2147483647. Default value is 60.
    - `value` string, required — A TXT record containing arbitrary text.
    - `comment` string — A comment to add context on what this DNS record is for
  - object
    - `type` 'NS', required — Must be of type `NS`.
    - `name` string, required — A subdomain name.
    - `ttl` number — The TTL value. Must be a number between 60 and 2147483647. Default value is 60.
    - `value` string — An NS domain value.
    - `comment` string — A comment to add context on what this DNS record is for
  - object
    - `type` 'HTTPS', required — Must be of type `HTTPS`.
    - `ttl` number — The TTL value. Must be a number between 60 and 2147483647. Default value is 60.
    - `https` object, required
      - `priority` number, nullable, required
      - `target` string, required
      - `params` string
    - `comment` string — A comment to add context on what this DNS record is for

## Response `200`

Successful response showing the uid of the newly created DNS record.

- union
  - object
    - `uid` string, required
    - `updated` number, required
  - object
    - `uid` string, required — The id of the newly created DNS record

## Other responses

- `400` — One of the provided values in the request body is invalid. One of the provided values in the request query is invalid.
- `401` — The request is not authorized.
- `402` — The account is missing a payment so payment method must be updated
- `403` — You do not have permission to access this resource.
- `404`
- `409`
- `410`

---

[API](https://skmtc.net/vercel/apis/api.md) · [All operations](https://skmtc.net/vercel/apis/api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vercel/api/versions/61d1ba3f6dac/schema)
