v8

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2025-10-165266542.4 MB
DigitalOcean-public.v2-new_Domain Records

List All Domain Records

To get a listing of all records configured for a domain, send a GET request to /v2/domains/$DOMAIN_NAME/records. The list of records returned can be filtered by using the name and type query parameters. For example, to only include A records for a domain, send a GET request to /v2/domains/$DOMAIN_NAME/records?type=A. name must be a fully qualified record name. For example, to only include records matching sub.example.com, send a GET request to /v2/domains/$DOMAIN_NAME/records?name=sub.example.com. Both name and type may be used together.

get/v2/domains/{domain_name}/records

Path parameters

domain_namestring required

The name of the domain itself.

Query parameters

namestring

A fully qualified record name. For example, to only include records matching sub.example.com, send a GET request to /v2/domains/$DOMAIN_NAME/records?name=sub.example.com.

type'A' | 'AAAA' | 'CAA' | 'CNAME' | 'MX' | 'NS' | 'SOA' | 'SRV' | 'TXT'

The type of the DNS record. For example: A, CNAME, TXT, ...

per_pageinteger

Number of items returned per page

pageinteger

Which 'page' of paginated results to return.

Response

The response will be a JSON object with a key called domain_records. The value of this will be an array of domain record objects, each of which contains the standard domain record attributes. For attributes that are not used by a specific record type, a value of null will be returned. For instance, all records other than SRV will have null for the weight and port attributes.

Example response

{
  "domain_records": [
    {
      "id": 28448429,
      "type": "NS",
      "name": "@",
      "data": "ns1.digitalocean.com",
      "ttl": 1800
    }
  ],
  "links": {
    "pages": {
      "last": "https://api.digitalocean.com/v2/images?page=2",
      "next": "https://api.digitalocean.com/v2/images?page=2"
    }
  },
  "meta": {
    "total": 1
  }
}