## List DNS Records `client.dns.records.list(RecordListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/zones/{zone_id}/dns_records` List, search, sort, and filter a zones' DNS records. ### Parameters - `params: RecordListParams` - `zone_id: string` Path param: Identifier. - `comment?: Comment` Query param - `absent?: string` If this parameter is present, only records *without* a comment are returned. - `contains?: string` Substring of the DNS record comment. Comment filters are case-insensitive. - `endswith?: string` Suffix of the DNS record comment. Comment filters are case-insensitive. - `exact?: string` Exact value of the DNS record comment. Comment filters are case-insensitive. - `present?: string` If this parameter is present, only records *with* a comment are returned. - `startswith?: string` Prefix of the DNS record comment. Comment filters are case-insensitive. - `content?: Content` Query param - `contains?: string` Substring of the DNS record content. Content filters are case-insensitive. - `endswith?: string` Suffix of the DNS record content. Content filters are case-insensitive. - `exact?: string` Exact value of the DNS record content. Content filters are case-insensitive. - `startswith?: string` Prefix of the DNS record content. Content filters are case-insensitive. - `direction?: SortDirection` Query param: Direction to order DNS records in. - `"asc"` - `"desc"` - `match?: "any" | "all"` Query param: Whether to match all search requirements or at least one (any). If set to `all`, acts like a logical AND between filters. If set to `any`, acts like a logical OR instead. Note that the interaction between tag filters is controlled by the `tag-match` parameter instead. - `"any"` - `"all"` - `name?: Name` Query param - `contains?: string` Substring of the DNS record name. Name filters are case-insensitive. - `endswith?: string` Suffix of the DNS record name. Name filters are case-insensitive. - `exact?: string` Exact value of the DNS record name. Name filters are case-insensitive. - `startswith?: string` Prefix of the DNS record name. Name filters are case-insensitive. - `order?: "type" | "name" | "content" | 2 more` Query param: Field to order DNS records by. - `"type"` - `"name"` - `"content"` - `"ttl"` - `"proxied"` - `page?: number` Query param: Page number of paginated results. - `per_page?: number` Query param: Number of DNS records per page. - `proxied?: boolean` Query param: Whether the record is receiving the performance and security benefits of Cloudflare. - `search?: string` Query param: Allows searching in multiple properties of a DNS record simultaneously. This parameter is intended for human users, not automation. Its exact behavior is intentionally left unspecified and is subject to change in the future. This parameter works independently of the `match` setting. For automated searches, please use the other available parameters. - `tag?: Tag` Query param - `absent?: string` Name of a tag which must *not* be present on the DNS record. Tag filters are case-insensitive. - `contains?: string` A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value contains ``. Tag filters are case-insensitive. - `endswith?: string` A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value ends with ``. Tag filters are case-insensitive. - `exact?: string` A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value is ``. Tag filters are case-insensitive. - `present?: string` Name of a tag which must be present on the DNS record. Tag filters are case-insensitive. - `startswith?: string` A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value starts with ``. Tag filters are case-insensitive. - `tag_match?: "any" | "all"` Query param: Whether to match all tag search requirements or at least one (any). If set to `all`, acts like a logical AND between tag filters. If set to `any`, acts like a logical OR instead. Note that the regular `match` parameter is still used to combine the resulting condition with other filters that aren't related to tags. - `"any"` - `"all"` - `type?: "A" | "AAAA" | "CAA" | 18 more` Query param: Record type. - `"A"` - `"AAAA"` - `"CAA"` - `"CERT"` - `"CNAME"` - `"DNSKEY"` - `"DS"` - `"HTTPS"` - `"LOC"` - `"MX"` - `"NAPTR"` - `"NS"` - `"OPENPGPKEY"` - `"PTR"` - `"SMIMEA"` - `"SRV"` - `"SSHFP"` - `"SVCB"` - `"TLSA"` - `"TXT"` - `"URI"` ### Returns - `RecordResponse = A | AAAA | CNAME | 18 more` - `A extends ARecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `AAAA extends AAAARecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `CNAME extends CNAMERecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `MX extends MXRecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `NS extends NSRecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `Openpgpkey` - `id: string` Identifier. - `comment: string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `content: string` A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1) - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `name: string` Complete DNS record name, including the zone name, in Punycode. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `proxied: boolean` Whether the record is receiving the performance and security benefits of Cloudflare. - `settings: Settings` Settings for the DNS record. - `ipv4_only?: boolean` When enabled, only A records will be generated, and AAAA records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6. - `ipv6_only?: boolean` When enabled, only AAAA records will be generated, and A records will not be created. This setting is intended for exceptional cases. Note that this option only applies to proxied records and it has no effect on whether Cloudflare communicates with the origin using IPv4 or IPv6. - `tags: Array` Custom tags for the DNS record. This field has no effect on DNS responses. - `ttl: TTL` Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. - `number` - `1` - `1` - `type: "OPENPGPKEY"` Record type. - `"OPENPGPKEY"` - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `PTR extends PTRRecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `TXT extends TXTRecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `CAA extends CAARecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `CERT extends CERTRecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `DNSKEY extends DNSKEYRecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `DS extends DSRecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `HTTPS extends HTTPSRecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `LOC extends LOCRecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `NAPTR extends NAPTRRecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `SMIMEA extends SMIMEARecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `SRV extends SRVRecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `SSHFP extends SSHFPRecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `SVCB extends SVCBRecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `TLSA extends TLSARecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. - `URI extends URIRecord` - `id: string` Identifier. - `created_on: string` When the record was created. - `meta: unknown` Extra Cloudflare-specific information about the record. - `modified_on: string` When the record was last modified. - `proxiable: boolean` Whether the record can be proxied by Cloudflare or not. - `comment_modified_on?: string` When the record comment was last modified. Omitted if there is no comment. - `tags_modified_on?: string` When the record tags were last modified. Omitted if there are no tags. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const recordResponse of client.dns.records.list({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(recordResponse); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "name": "example.com", "ttl": 3600, "type": "A", "comment": "Domain verification record", "content": "198.51.100.4", "private_routing": true, "proxied": true, "settings": { "ipv4_only": true, "ipv6_only": true }, "tags": [ "owner:dns-team" ], "id": "023e105f4ecef8ad9ca31a8372d0c353", "created_on": "2014-01-01T05:20:00.12345Z", "meta": {}, "modified_on": "2014-01-01T05:20:00.12345Z", "proxiable": true, "comment_modified_on": "2024-01-01T05:20:00.12345Z", "tags_modified_on": "2025-01-01T05:20:00.12345Z" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ```