---
title: update-an-existing-dns-record
product: vercel
url: /docs/rest-api/dns/update-an-existing-dns-record
canonical_url: "https://vercel.com/docs/rest-api/dns/update-an-existing-dns-record"
last_updated: 2026-09-15
type: reference
prerequisites:
  []
related:
  - /docs/rest-api
summary: Learn about update-an-existing-dns-record on Vercel.
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---

# Update an existing DNS record

```http
PATCH /v1/domains/records/{recordId}
```

Updates an existing DNS record for a domain name.

## Authentication

**bearerToken**: HTTP bearer

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `recordId` | string | Yes | The id of the DNS record |


## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `teamId` | string | No | The Team identifier to perform the request on behalf of. |
| `slug` | string | No | The Team slug to perform the request on behalf of. |


## Request body

Required: Yes

Content-Type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The name of the DNS record",
      "nullable": true
    },
    "value": {
      "type": "string",
      "description": "The value of the DNS record",
      "nullable": true
    },
    "type": {
      "type": "string",
      "description": "The type of the DNS record",
      "enum": [
        "A",
        "AAAA",
        "ALIAS",
        "CAA",
        "CNAME",
        "HTTPS",
        "MX",
        "SRV",
        "TXT",
        "NS",
        null
      ],
      "maxLength": 255,
      "nullable": true
    },
    "ttl": {
      "type": "integer",
      "description": "The Time to live (TTL) value of the DNS record",
      "minimum": 60,
      "maximum": 2147483647,
      "nullable": true
    },
    "mxPriority": {
      "type": "integer",
      "description": "The MX priority value of the DNS record",
      "nullable": true
    },
    "srv": {
      "type": "object",
      "nullable": true,
      "required": [
        "target",
        "weight",
        "port",
        "priority"
      ],
      "properties": {
        "target": {
          "type": "string",
          "maxLength": 255,
          "nullable": true
        },
        "weight": {
          "type": "integer",
          "nullable": true
        },
        "port": {
          "type": "integer",
          "nullable": true
        },
        "priority": {
          "type": "integer",
          "nullable": true
        }
      }
    },
    "https": {
      "type": "object",
      "nullable": true,
      "required": [
        "priority",
        "target"
      ],
      "properties": {
        "priority": {
          "type": "integer",
          "nullable": true
        },
        "target": {
          "type": "string",
          "maxLength": 255,
          "nullable": true
        },
        "params": {
          "type": "string",
          "nullable": true
        }
      }
    },
    "comment": {
      "type": "string",
      "description": "A comment to add context on what this DNS record is for",
      "maxLength": 500
    }
  }
}
```

## Example request

### TypeScript

```typescript
const response = await fetch('https://api.vercel.com/v1/domains/records/recordId?teamId=string&slug=string', {
  method: 'PATCH',
  headers: {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "name": "example-1",
    "value": "google.com",
    "type": "A",
    "ttl": "60",
    "mxPriority": "123",
    "srv": {
      "target": "example2.com.",
      "weight": "123",
      "port": "123",
      "priority": "123"
    },
    "https": {
      "priority": "123",
      "target": "example2.com.",
      "params": "string"
    },
    "comment": "used to verify ownership of domain"
  }),
});

const data = await response.json();
console.log(data);
```

### Next.js

```typescript
'use server';

export async function callEndpoint() {
  const response = await fetch('https://api.vercel.com/v1/domains/records/recordId?teamId=string&slug=string', {
    method: 'PATCH',
    headers: {
      'Authorization': `Bearer ${process.env.VERCEL_ACCESS_TOKEN}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      "name": "example-1",
      "value": "google.com",
      "type": "A",
      "ttl": "60",
      "mxPriority": "123",
      "srv": {
        "target": "example2.com.",
        "weight": "123",
        "port": "123",
        "priority": "123"
      },
      "https": {
        "priority": "123",
        "target": "example2.com.",
        "params": "string"
      },
      "comment": "used to verify ownership of domain"
    }),
    next: { revalidate: 3600 }
  });

  if (!response.ok) {
    throw new Error('Request failed');
  }

  return response.json();
}
```

### cURL

```bash
curl -X PATCH 'https://api.vercel.com/v1/domains/records/recordId?teamId=string&slug=string' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d "{
    \"name\": \"example-1\",
    \"value\": \"google.com\",
    \"type\": \"A\",
    \"ttl\": \"60\",
    \"mxPriority\": \"123\",
    \"srv\": {
      \"target\": \"example2.com.\",
      \"weight\": \"123\",
      \"port\": \"123\",
      \"priority\": \"123\"
    },
    \"https\": {
      \"priority\": \"123\",
      \"target\": \"example2.com.\",
      \"params\": \"string\"
    },
    \"comment\": \"used to verify ownership of domain\"
  }"
```

## Example response

```json
{
  "comment": "string",
  "createdAt": "123",
  "creator": "string",
  "domain": "string",
  "id": "icfg_1234567890",
  "name": "Example Name",
  "recordType": "A",
  "ttl": "123",
  "type": "record",
  "value": "string"
}
```

## Responses

### 200: No description

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "creator",
    "domain",
    "id",
    "name",
    "recordType",
    "type",
    "value"
  ],
  "properties": {
    "comment": {
      "type": "string"
    },
    "createdAt": {
      "type": "number",
      "nullable": true
    },
    "creator": {
      "type": "string"
    },
    "domain": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "recordType": {
      "type": "string",
      "enum": [
        "A",
        "AAAA",
        "ALIAS",
        "CAA",
        "CNAME",
        "HTTPS",
        "MX",
        "NS",
        "SRV",
        "TXT"
      ]
    },
    "ttl": {
      "type": "number"
    },
    "type": {
      "type": "string",
      "enum": [
        "record",
        "record-sys"
      ]
    },
    "value": {
      "type": "string"
    }
  }
}
```

### 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: No description

### 409: No description

### 410: No description

---

## Related

- [dns endpoints](/docs/rest-api#dns)

- [REST API overview](/docs/rest-api)

- [OpenAPI spec](https://openapi.vercel.sh/) (machine-readable, all endpoints)

---

[View full sitemap](/docs/sitemap)
