# DNS # DNSSEC ## DNSSEC Details `client.DNS.DNSSEC.Get(ctx, query) (*DNSSEC, error)` **get** `/zones/{zone_id}/dnssec` Details about DNSSEC status and configuration. ### Parameters - `query DNSSECGetParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type DNSSEC struct{…}` - `Algorithm string` Algorithm key code. - `Digest string` Digest hash. - `DigestAlgorithm string` Type of digest algorithm. - `DigestType string` Coded type for digest algorithm. - `DNSSECMultiSigner bool` If true, multi-signer DNSSEC is enabled on the zone, allowing multiple providers to serve a DNSSEC-signed zone at the same time. This is required for DNSKEY records (except those automatically generated by Cloudflare) to be added to the zone. See [Multi-signer DNSSEC](https://developers.cloudflare.com/dns/dnssec/multi-signer-dnssec/) for details. - `DNSSECPresigned bool` If true, allows Cloudflare to transfer in a DNSSEC-signed zone including signatures from an external provider, without requiring Cloudflare to sign any records on the fly. Note that this feature has some limitations. See [Cloudflare as Secondary](https://developers.cloudflare.com/dns/zone-setups/zone-transfers/cloudflare-as-secondary/setup/#dnssec) for details. - `DNSSECUseNsec3 bool` If true, enables the use of NSEC3 together with DNSSEC on the zone. Combined with setting dnssec_presigned to true, this enables the use of NSEC3 records when transferring in from an external provider. If dnssec_presigned is instead set to false (default), NSEC3 records will be generated and signed at request time. See [DNSSEC with NSEC3](https://developers.cloudflare.com/dns/dnssec/enable-nsec3/) for details. - `DS string` Full DS record. - `Flags float64` Flag for DNSSEC record. - `KeyTag float64` Code for key tag. - `KeyType string` Algorithm key type. - `ModifiedOn Time` When DNSSEC was last modified. - `PublicKey string` Public key for DS record. - `Status DNSSECStatus` Status of DNSSEC, based on user-desired state and presence of necessary records. - `const DNSSECStatusActive DNSSECStatus = "active"` - `const DNSSECStatusPending DNSSECStatus = "pending"` - `const DNSSECStatusDisabled DNSSECStatus = "disabled"` - `const DNSSECStatusPendingDisabled DNSSECStatus = "pending-disabled"` - `const DNSSECStatusError DNSSECStatus = "error"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) dnssec, err := client.DNS.DNSSEC.Get(context.TODO(), dns.DNSSECGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", dnssec.Algorithm) } ``` #### 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": { "algorithm": "13", "digest": "48E939042E82C22542CB377B580DFDC52A361CEFDC72E7F9107E2B6BD9306A45", "digest_algorithm": "SHA256", "digest_type": "2", "dnssec_multi_signer": false, "dnssec_presigned": true, "dnssec_use_nsec3": false, "ds": "example.com. 3600 IN DS 16953 13 2 48E939042E82C22542CB377B580DFDC52A361CEFDC72E7F9107E2B6BD9306A45", "flags": 257, "key_tag": 42, "key_type": "ECDSAP256SHA256", "modified_on": "2014-01-01T05:20:00Z", "public_key": "oXiGYrSTO+LSCJ3mohc8EP+CzF9KxBj8/ydXJ22pKuZP3VAC3/Md/k7xZfz470CoRyZJ6gV6vml07IC3d8xqhA==", "status": "active" } } ``` ## Edit DNSSEC Status `client.DNS.DNSSEC.Edit(ctx, params) (*DNSSEC, error)` **patch** `/zones/{zone_id}/dnssec` Enable or disable DNSSEC. ### Parameters - `params DNSSECEditParams` - `ZoneID param.Field[string]` Path param: Identifier. - `DNSSECMultiSigner param.Field[bool]` Body param: If true, multi-signer DNSSEC is enabled on the zone, allowing multiple providers to serve a DNSSEC-signed zone at the same time. This is required for DNSKEY records (except those automatically generated by Cloudflare) to be added to the zone. See [Multi-signer DNSSEC](https://developers.cloudflare.com/dns/dnssec/multi-signer-dnssec/) for details. - `DNSSECPresigned param.Field[bool]` Body param: If true, allows Cloudflare to transfer in a DNSSEC-signed zone including signatures from an external provider, without requiring Cloudflare to sign any records on the fly. Note that this feature has some limitations. See [Cloudflare as Secondary](https://developers.cloudflare.com/dns/zone-setups/zone-transfers/cloudflare-as-secondary/setup/#dnssec) for details. - `DNSSECUseNsec3 param.Field[bool]` Body param: If true, enables the use of NSEC3 together with DNSSEC on the zone. Combined with setting dnssec_presigned to true, this enables the use of NSEC3 records when transferring in from an external provider. If dnssec_presigned is instead set to false (default), NSEC3 records will be generated and signed at request time. See [DNSSEC with NSEC3](https://developers.cloudflare.com/dns/dnssec/enable-nsec3/) for details. - `Status param.Field[DNSSECEditParamsStatus]` Body param: Status of DNSSEC, based on user-desired state and presence of necessary records. - `const DNSSECEditParamsStatusActive DNSSECEditParamsStatus = "active"` - `const DNSSECEditParamsStatusDisabled DNSSECEditParamsStatus = "disabled"` ### Returns - `type DNSSEC struct{…}` - `Algorithm string` Algorithm key code. - `Digest string` Digest hash. - `DigestAlgorithm string` Type of digest algorithm. - `DigestType string` Coded type for digest algorithm. - `DNSSECMultiSigner bool` If true, multi-signer DNSSEC is enabled on the zone, allowing multiple providers to serve a DNSSEC-signed zone at the same time. This is required for DNSKEY records (except those automatically generated by Cloudflare) to be added to the zone. See [Multi-signer DNSSEC](https://developers.cloudflare.com/dns/dnssec/multi-signer-dnssec/) for details. - `DNSSECPresigned bool` If true, allows Cloudflare to transfer in a DNSSEC-signed zone including signatures from an external provider, without requiring Cloudflare to sign any records on the fly. Note that this feature has some limitations. See [Cloudflare as Secondary](https://developers.cloudflare.com/dns/zone-setups/zone-transfers/cloudflare-as-secondary/setup/#dnssec) for details. - `DNSSECUseNsec3 bool` If true, enables the use of NSEC3 together with DNSSEC on the zone. Combined with setting dnssec_presigned to true, this enables the use of NSEC3 records when transferring in from an external provider. If dnssec_presigned is instead set to false (default), NSEC3 records will be generated and signed at request time. See [DNSSEC with NSEC3](https://developers.cloudflare.com/dns/dnssec/enable-nsec3/) for details. - `DS string` Full DS record. - `Flags float64` Flag for DNSSEC record. - `KeyTag float64` Code for key tag. - `KeyType string` Algorithm key type. - `ModifiedOn Time` When DNSSEC was last modified. - `PublicKey string` Public key for DS record. - `Status DNSSECStatus` Status of DNSSEC, based on user-desired state and presence of necessary records. - `const DNSSECStatusActive DNSSECStatus = "active"` - `const DNSSECStatusPending DNSSECStatus = "pending"` - `const DNSSECStatusDisabled DNSSECStatus = "disabled"` - `const DNSSECStatusPendingDisabled DNSSECStatus = "pending-disabled"` - `const DNSSECStatusError DNSSECStatus = "error"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) dnssec, err := client.DNS.DNSSEC.Edit(context.TODO(), dns.DNSSECEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", dnssec.Algorithm) } ``` #### 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": { "algorithm": "13", "digest": "48E939042E82C22542CB377B580DFDC52A361CEFDC72E7F9107E2B6BD9306A45", "digest_algorithm": "SHA256", "digest_type": "2", "dnssec_multi_signer": false, "dnssec_presigned": true, "dnssec_use_nsec3": false, "ds": "example.com. 3600 IN DS 16953 13 2 48E939042E82C22542CB377B580DFDC52A361CEFDC72E7F9107E2B6BD9306A45", "flags": 257, "key_tag": 42, "key_type": "ECDSAP256SHA256", "modified_on": "2014-01-01T05:20:00Z", "public_key": "oXiGYrSTO+LSCJ3mohc8EP+CzF9KxBj8/ydXJ22pKuZP3VAC3/Md/k7xZfz470CoRyZJ6gV6vml07IC3d8xqhA==", "status": "active" } } ``` ## Delete DNSSEC records `client.DNS.DNSSEC.Delete(ctx, body) (*string, error)` **delete** `/zones/{zone_id}/dnssec` Delete DNSSEC. ### Parameters - `body DNSSECDeleteParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type DNSSECDeleteResponseEnvelopeResult string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) dnssec, err := client.DNS.DNSSEC.Delete(context.TODO(), dns.DNSSECDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", dnssec) } ``` #### 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": "" } ``` ## Domain Types ### DNSSEC - `type DNSSEC struct{…}` - `Algorithm string` Algorithm key code. - `Digest string` Digest hash. - `DigestAlgorithm string` Type of digest algorithm. - `DigestType string` Coded type for digest algorithm. - `DNSSECMultiSigner bool` If true, multi-signer DNSSEC is enabled on the zone, allowing multiple providers to serve a DNSSEC-signed zone at the same time. This is required for DNSKEY records (except those automatically generated by Cloudflare) to be added to the zone. See [Multi-signer DNSSEC](https://developers.cloudflare.com/dns/dnssec/multi-signer-dnssec/) for details. - `DNSSECPresigned bool` If true, allows Cloudflare to transfer in a DNSSEC-signed zone including signatures from an external provider, without requiring Cloudflare to sign any records on the fly. Note that this feature has some limitations. See [Cloudflare as Secondary](https://developers.cloudflare.com/dns/zone-setups/zone-transfers/cloudflare-as-secondary/setup/#dnssec) for details. - `DNSSECUseNsec3 bool` If true, enables the use of NSEC3 together with DNSSEC on the zone. Combined with setting dnssec_presigned to true, this enables the use of NSEC3 records when transferring in from an external provider. If dnssec_presigned is instead set to false (default), NSEC3 records will be generated and signed at request time. See [DNSSEC with NSEC3](https://developers.cloudflare.com/dns/dnssec/enable-nsec3/) for details. - `DS string` Full DS record. - `Flags float64` Flag for DNSSEC record. - `KeyTag float64` Code for key tag. - `KeyType string` Algorithm key type. - `ModifiedOn Time` When DNSSEC was last modified. - `PublicKey string` Public key for DS record. - `Status DNSSECStatus` Status of DNSSEC, based on user-desired state and presence of necessary records. - `const DNSSECStatusActive DNSSECStatus = "active"` - `const DNSSECStatusPending DNSSECStatus = "pending"` - `const DNSSECStatusDisabled DNSSECStatus = "disabled"` - `const DNSSECStatusPendingDisabled DNSSECStatus = "pending-disabled"` - `const DNSSECStatusError DNSSECStatus = "error"` # Records ## List DNS Records `client.DNS.Records.List(ctx, params) (*V4PagePaginationArray[RecordResponse], error)` **get** `/zones/{zone_id}/dns_records` List, search, sort, and filter a zones' DNS records. ### Parameters - `params RecordListParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Comment param.Field[RecordListParamsComment]` 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 param.Field[RecordListParamsContent]` 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 param.Field[SortDirection]` Query param: Direction to order DNS records in. - `Match param.Field[RecordListParamsMatch]` 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. - `const RecordListParamsMatchAny RecordListParamsMatch = "any"` - `const RecordListParamsMatchAll RecordListParamsMatch = "all"` - `Name param.Field[RecordListParamsName]` 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 param.Field[RecordListParamsOrder]` Query param: Field to order DNS records by. - `const RecordListParamsOrderType RecordListParamsOrder = "type"` - `const RecordListParamsOrderName RecordListParamsOrder = "name"` - `const RecordListParamsOrderContent RecordListParamsOrder = "content"` - `const RecordListParamsOrderTTL RecordListParamsOrder = "ttl"` - `const RecordListParamsOrderProxied RecordListParamsOrder = "proxied"` - `Page param.Field[float64]` Query param: Page number of paginated results. - `PerPage param.Field[float64]` Query param: Number of DNS records per page. - `Proxied param.Field[bool]` Query param: Whether the record is receiving the performance and security benefits of Cloudflare. - `Search param.Field[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 param.Field[RecordListParamsTag]` 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. - `TagMatch param.Field[RecordListParamsTagMatch]` 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. - `const RecordListParamsTagMatchAny RecordListParamsTagMatch = "any"` - `const RecordListParamsTagMatchAll RecordListParamsTagMatch = "all"` - `Type param.Field[RecordListParamsType]` Query param: Record type. - `const RecordListParamsTypeA RecordListParamsType = "A"` - `const RecordListParamsTypeAAAA RecordListParamsType = "AAAA"` - `const RecordListParamsTypeCAA RecordListParamsType = "CAA"` - `const RecordListParamsTypeCERT RecordListParamsType = "CERT"` - `const RecordListParamsTypeCNAME RecordListParamsType = "CNAME"` - `const RecordListParamsTypeDNSKEY RecordListParamsType = "DNSKEY"` - `const RecordListParamsTypeDS RecordListParamsType = "DS"` - `const RecordListParamsTypeHTTPS RecordListParamsType = "HTTPS"` - `const RecordListParamsTypeLOC RecordListParamsType = "LOC"` - `const RecordListParamsTypeMX RecordListParamsType = "MX"` - `const RecordListParamsTypeNAPTR RecordListParamsType = "NAPTR"` - `const RecordListParamsTypeNS RecordListParamsType = "NS"` - `const RecordListParamsTypeOpenpgpkey RecordListParamsType = "OPENPGPKEY"` - `const RecordListParamsTypePTR RecordListParamsType = "PTR"` - `const RecordListParamsTypeSMIMEA RecordListParamsType = "SMIMEA"` - `const RecordListParamsTypeSRV RecordListParamsType = "SRV"` - `const RecordListParamsTypeSSHFP RecordListParamsType = "SSHFP"` - `const RecordListParamsTypeSVCB RecordListParamsType = "SVCB"` - `const RecordListParamsTypeTLSA RecordListParamsType = "TLSA"` - `const RecordListParamsTypeTXT RecordListParamsType = "TXT"` - `const RecordListParamsTypeURI RecordListParamsType = "URI"` ### Returns - `type RecordResponse interface{…}` - `type RecordResponseA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseAAAA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCNAME struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseMX struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseNS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseOpenpgpkey struct{…}` - `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) - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Name string` Complete DNS record name, including the zone name, in Punycode. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings RecordResponseOpenpgpkeySettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` 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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type RecordResponseOpenpgpkeyType` Record type. - `const RecordResponseOpenpgpkeyTypeOpenpgpkey RecordResponseOpenpgpkeyType = "OPENPGPKEY"` - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponsePTR struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseTXT struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCAA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCERT struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseDNSKEY struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseDS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseHTTPS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseLOC struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseNAPTR struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSMIMEA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSRV struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSSHFP struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSVCB struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseTLSA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseURI struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.DNS.Records.List(context.TODO(), dns.RecordListParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### 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 } } ``` ## DNS Record Details `client.DNS.Records.Get(ctx, dnsRecordID, query) (*RecordResponse, error)` **get** `/zones/{zone_id}/dns_records/{dns_record_id}` DNS Record Details ### Parameters - `dnsRecordID string` Identifier. - `query RecordGetParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type RecordResponse interface{…}` - `type RecordResponseA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseAAAA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCNAME struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseMX struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseNS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseOpenpgpkey struct{…}` - `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) - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Name string` Complete DNS record name, including the zone name, in Punycode. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings RecordResponseOpenpgpkeySettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` 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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type RecordResponseOpenpgpkeyType` Record type. - `const RecordResponseOpenpgpkeyTypeOpenpgpkey RecordResponseOpenpgpkeyType = "OPENPGPKEY"` - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponsePTR struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseTXT struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCAA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCERT struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseDNSKEY struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseDS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseHTTPS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseLOC struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseNAPTR struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSMIMEA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSRV struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSSHFP struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSVCB struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseTLSA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseURI struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) recordResponse, err := client.DNS.Records.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", dns.RecordGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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" } } ``` ## Create DNS Record `client.DNS.Records.New(ctx, params) (*RecordResponse, error)` **post** `/zones/{zone_id}/dns_records` Create a new DNS record for a zone. Notes: - A/AAAA records cannot exist on the same name as CNAME records. - NS records cannot exist on the same name as any other record type. - Domain names are always represented in Punycode, even if Unicode characters were used when creating the record. ### Parameters - `params RecordNewParams` - `ZoneID param.Field[string]` Path param: Identifier. - `ARecord param.Field[ARecord]` Body param ### Returns - `type RecordResponse interface{…}` - `type RecordResponseA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseAAAA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCNAME struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseMX struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseNS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseOpenpgpkey struct{…}` - `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) - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Name string` Complete DNS record name, including the zone name, in Punycode. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings RecordResponseOpenpgpkeySettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` 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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type RecordResponseOpenpgpkeyType` Record type. - `const RecordResponseOpenpgpkeyTypeOpenpgpkey RecordResponseOpenpgpkeyType = "OPENPGPKEY"` - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponsePTR struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseTXT struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCAA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCERT struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseDNSKEY struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseDS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseHTTPS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseLOC struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseNAPTR struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSMIMEA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSRV struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSSHFP struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSVCB struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseTLSA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseURI struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) recordResponse, err := client.DNS.Records.New(context.TODO(), dns.RecordNewParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Body: dns.ARecordParam{ Name: cloudflare.F("example.com"), TTL: cloudflare.F(dns.TTL1), Type: cloudflare.F(dns.ARecordTypeA), }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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" } } ``` ## Overwrite DNS Record `client.DNS.Records.Update(ctx, dnsRecordID, params) (*RecordResponse, error)` **put** `/zones/{zone_id}/dns_records/{dns_record_id}` Overwrite an existing DNS record. Notes: - A/AAAA records cannot exist on the same name as CNAME records. - NS records cannot exist on the same name as any other record type. - Domain names are always represented in Punycode, even if Unicode characters were used when creating the record. ### Parameters - `dnsRecordID string` Identifier. - `params RecordUpdateParams` - `ZoneID param.Field[string]` Path param: Identifier. - `ARecord param.Field[ARecord]` Body param ### Returns - `type RecordResponse interface{…}` - `type RecordResponseA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseAAAA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCNAME struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseMX struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseNS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseOpenpgpkey struct{…}` - `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) - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Name string` Complete DNS record name, including the zone name, in Punycode. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings RecordResponseOpenpgpkeySettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` 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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type RecordResponseOpenpgpkeyType` Record type. - `const RecordResponseOpenpgpkeyTypeOpenpgpkey RecordResponseOpenpgpkeyType = "OPENPGPKEY"` - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponsePTR struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseTXT struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCAA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCERT struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseDNSKEY struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseDS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseHTTPS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseLOC struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseNAPTR struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSMIMEA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSRV struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSSHFP struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSVCB struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseTLSA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseURI struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) recordResponse, err := client.DNS.Records.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", dns.RecordUpdateParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Body: dns.ARecordParam{ Name: cloudflare.F("example.com"), TTL: cloudflare.F(dns.TTL1), Type: cloudflare.F(dns.ARecordTypeA), }, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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" } } ``` ## Update DNS Record `client.DNS.Records.Edit(ctx, dnsRecordID, params) (*RecordResponse, error)` **patch** `/zones/{zone_id}/dns_records/{dns_record_id}` Update an existing DNS record. Notes: - A/AAAA records cannot exist on the same name as CNAME records. - NS records cannot exist on the same name as any other record type. - Domain names are always represented in Punycode, even if Unicode characters were used when creating the record. ### Parameters - `dnsRecordID string` Identifier. - `params RecordEditParams` - `ZoneID param.Field[string]` Path param: Identifier. - `ARecord param.Field[ARecord]` Body param ### Returns - `type RecordResponse interface{…}` - `type RecordResponseA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseAAAA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCNAME struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseMX struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseNS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseOpenpgpkey struct{…}` - `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) - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Name string` Complete DNS record name, including the zone name, in Punycode. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings RecordResponseOpenpgpkeySettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` 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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type RecordResponseOpenpgpkeyType` Record type. - `const RecordResponseOpenpgpkeyTypeOpenpgpkey RecordResponseOpenpgpkeyType = "OPENPGPKEY"` - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponsePTR struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseTXT struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCAA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCERT struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseDNSKEY struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseDS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseHTTPS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseLOC struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseNAPTR struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSMIMEA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSRV struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSSHFP struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSVCB struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseTLSA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseURI struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) recordResponse, err := client.DNS.Records.Edit( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", dns.RecordEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Body: dns.ARecordParam{ Name: cloudflare.F("example.com"), TTL: cloudflare.F(dns.TTL1), Type: cloudflare.F(dns.ARecordTypeA), }, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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" } } ``` ## Delete DNS Record `client.DNS.Records.Delete(ctx, dnsRecordID, body) (*RecordDeleteResponse, error)` **delete** `/zones/{zone_id}/dns_records/{dns_record_id}` Delete DNS Record ### Parameters - `dnsRecordID string` Identifier. - `body RecordDeleteParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type RecordDeleteResponse struct{…}` - `ID string` Identifier. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) record, err := client.DNS.Records.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", dns.RecordDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", record.ID) } ``` #### Response ```json { "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353" } } ``` ## Export DNS Records `client.DNS.Records.Export(ctx, query) (*string, error)` **get** `/zones/{zone_id}/dns_records/export` You can export your [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this endpoint. See [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records") for more information. ### Parameters - `query RecordExportParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type RecordExportResponse string` Exported BIND zone file. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DNS.Records.Export(context.TODO(), dns.RecordExportParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` ## Import DNS Records `client.DNS.Records.Import(ctx, params) (*RecordImportResponse, error)` **post** `/zones/{zone_id}/dns_records/import` You can upload your [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this endpoint. It assumes that cURL is called from a location with bind_config.txt (valid BIND config) present. See [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records") for more information. ### Parameters - `params RecordImportParams` - `ZoneID param.Field[string]` Path param: Identifier. - `File param.Field[string]` Body param: BIND config to import. **Tip:** When using cURL, a file can be uploaded using `--form 'file=@bind_config.txt'`. - `Proxied param.Field[string]` Body param: Whether or not proxiable records should receive the performance and security benefits of Cloudflare. The value should be either `true` or `false`. ### Returns - `type RecordImportResponse struct{…}` - `RecsAdded float64` Number of DNS records added. - `TotalRecordsParsed float64` Total number of DNS records parsed. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DNS.Records.Import(context.TODO(), dns.RecordImportParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), File: cloudflare.F("www.example.com. 300 IN A 127.0.0.1"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.RecsAdded) } ``` #### 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": { "recs_added": 5, "total_records_parsed": 5 } } ``` ## Scan DNS Records `client.DNS.Records.Scan(ctx, params) (*RecordScanResponse, error)` **post** `/zones/{zone_id}/dns_records/scan` Scan for common DNS records on your domain and automatically add them to your zone. Useful if you haven't updated your nameservers yet. ### Parameters - `params RecordScanParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Body param.Field[unknown]` Body param ### Returns - `type RecordScanResponse struct{…}` - `RecsAdded float64` Number of DNS records added. - `TotalRecordsParsed float64` Total number of DNS records parsed. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DNS.Records.Scan(context.TODO(), dns.RecordScanParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Body: map[string]interface{}{ }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.RecsAdded) } ``` #### 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": { "recs_added": 5, "total_records_parsed": 5 } } ``` ## Trigger DNS Record Scan `client.DNS.Records.ScanTrigger(ctx, body) (*RecordScanTriggerResponse, error)` **post** `/zones/{zone_id}/dns_records/scan/trigger` Initiates an asynchronous scan for common DNS records on your domain. Note that this **does not** automatically add records to your zone. The scan runs in the background, and results can be reviewed later using the `/scan/review` endpoints. Useful if you haven't updated your nameservers yet. ### Parameters - `body RecordScanTriggerParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type RecordScanTriggerResponse struct{…}` - `Errors []RecordScanTriggerResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source RecordScanTriggerResponseErrorsSource` - `Pointer string` - `Messages []RecordScanTriggerResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source RecordScanTriggerResponseMessagesSource` - `Pointer string` - `Success RecordScanTriggerResponseSuccess` Whether the API call was successful. - `const RecordScanTriggerResponseSuccessTrue RecordScanTriggerResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DNS.Records.ScanTrigger(context.TODO(), dns.RecordScanTriggerParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Errors) } ``` #### 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 } ``` ## Review Scanned DNS Records `client.DNS.Records.ScanReview(ctx, params) (*RecordScanReviewResponse, error)` **post** `/zones/{zone_id}/dns_records/scan/review` Accept or reject DNS records found by the DNS records scan. Accepted records will be permanently added to the zone, while rejected records will be permanently deleted. ### Parameters - `params RecordScanReviewParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Accepts param.Field[[]RecordScanReviewParamsAccept]` Body param - `type ARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type ARecordType` Record type. - `const ARecordTypeA ARecordType = "A"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid IPv4 address. - `PrivateRouting bool` Enables private network routing to the origin. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings ARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type AAAARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type AAAARecordType` Record type. - `const AAAARecordTypeAAAA AAAARecordType = "AAAA"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid IPv6 address. - `PrivateRouting bool` Enables private network routing to the origin. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings AAAARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type CNAMERecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type CNAMERecordType` Record type. - `const CNAMERecordTypeCNAME CNAMERecordType = "CNAME"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid hostname. Must not match the record's name. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings CNAMERecordSettings` Settings for the DNS record. - `FlattenCNAME bool` If enabled, causes the CNAME record to be resolved externally and the resulting address records (e.g., A and AAAA) to be returned instead of the CNAME record itself. This setting is unavailable for proxied records, since they are always flattened. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type MXRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type MXRecordType` Record type. - `const MXRecordTypeMX MXRecordType = "MX"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid mail server hostname. - `Priority float64` Required for MX and URI records; ignored for other record types (but may still be returned by the API). Records with lower priorities are preferred. This field is to be deprecated in favor of the priority field within the data map. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings MXRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type NSRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type NSRecordType` Record type. - `const NSRecordTypeNS NSRecordType = "NS"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid name server host name. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings NSRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type RecordScanReviewParamsAcceptsDNSRecordsOpenpgpkeyRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type RecordScanReviewParamsAcceptsDNSRecordsOpenpgpkeyRecordType` Record type. - `const RecordScanReviewParamsAcceptsDNSRecordsOpenpgpkeyRecordTypeOpenpgpkey RecordScanReviewParamsAcceptsDNSRecordsOpenpgpkeyRecordType = "OPENPGPKEY"` - `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) - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings RecordScanReviewParamsAcceptsDNSRecordsOpenpgpkeyRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type PTRRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type PTRRecordType` Record type. - `const PTRRecordTypePTR PTRRecordType = "PTR"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Domain name pointing to the address. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings PTRRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type TXTRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type TXTRecordType` Record type. - `const TXTRecordTypeTXT TXTRecordType = "TXT"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Text content for the record. The content must consist of quoted "character strings" (RFC 1035), each with a length of up to 255 bytes. Strings exceeding this allowed maximum length are automatically split. Learn more at . - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings TXTRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type CAARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type CAARecordType` Record type. - `const CAARecordTypeCAA CAARecordType = "CAA"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted CAA content. See 'data' to set CAA properties. - `Data CAARecordData` Components of a CAA record. - `Flags float64` Flags for the CAA record. - `Tag string` Name of the property controlled by this record (e.g.: issue, issuewild, iodef). - `Value string` Value of the record. This field's semantics depend on the chosen tag. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings CAARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type CERTRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type CERTRecordType` Record type. - `const CERTRecordTypeCERT CERTRecordType = "CERT"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted CERT content. See 'data' to set CERT properties. - `Data CERTRecordData` Components of a CERT record. - `Algorithm float64` Algorithm. - `Certificate string` Certificate. - `KeyTag float64` Key Tag. - `Type float64` Type. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings CERTRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type DNSKEYRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type DNSKEYRecordType` Record type. - `const DNSKEYRecordTypeDNSKEY DNSKEYRecordType = "DNSKEY"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted DNSKEY content. See 'data' to set DNSKEY properties. - `Data DNSKEYRecordData` Components of a DNSKEY record. - `Algorithm float64` Algorithm. - `Flags float64` Flags. - `Protocol float64` Protocol. - `PublicKey string` Public Key. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings DNSKEYRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type DSRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type DSRecordType` Record type. - `const DSRecordTypeDS DSRecordType = "DS"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted DS content. See 'data' to set DS properties. - `Data DSRecordData` Components of a DS record. - `Algorithm float64` Algorithm. - `Digest string` Digest. - `DigestType float64` Digest Type. - `KeyTag float64` Key Tag. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings DSRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type HTTPSRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type HTTPSRecordType` Record type. - `const HTTPSRecordTypeHTTPS HTTPSRecordType = "HTTPS"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted HTTPS content. See 'data' to set HTTPS properties. - `Data HTTPSRecordData` Components of a HTTPS record. - `Priority float64` Priority. - `Target string` Target. - `Value string` Value. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings HTTPSRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type LOCRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type LOCRecordType` Record type. - `const LOCRecordTypeLOC LOCRecordType = "LOC"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted LOC content. See 'data' to set LOC properties. - `Data LOCRecordData` Components of a LOC record. - `Altitude float64` Altitude of location in meters. - `LatDegrees float64` Degrees of latitude. - `LatDirection LOCRecordDataLatDirection` Latitude direction. - `const LOCRecordDataLatDirectionN LOCRecordDataLatDirection = "N"` - `const LOCRecordDataLatDirectionS LOCRecordDataLatDirection = "S"` - `LatMinutes float64` Minutes of latitude. - `LatSeconds float64` Seconds of latitude. - `LongDegrees float64` Degrees of longitude. - `LongDirection LOCRecordDataLongDirection` Longitude direction. - `const LOCRecordDataLongDirectionE LOCRecordDataLongDirection = "E"` - `const LOCRecordDataLongDirectionW LOCRecordDataLongDirection = "W"` - `LongMinutes float64` Minutes of longitude. - `LongSeconds float64` Seconds of longitude. - `PrecisionHorz float64` Horizontal precision of location. - `PrecisionVert float64` Vertical precision of location. - `Size float64` Size of location in meters. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings LOCRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type NAPTRRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type NAPTRRecordType` Record type. - `const NAPTRRecordTypeNAPTR NAPTRRecordType = "NAPTR"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted NAPTR content. See 'data' to set NAPTR properties. - `Data NAPTRRecordData` Components of a NAPTR record. - `Flags string` Flags. - `Order float64` Order. - `Preference float64` Preference. - `Regex string` Regex. - `Replacement string` Replacement. - `Service string` Service. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings NAPTRRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type SMIMEARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type SMIMEARecordType` Record type. - `const SMIMEARecordTypeSMIMEA SMIMEARecordType = "SMIMEA"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted SMIMEA content. See 'data' to set SMIMEA properties. - `Data SMIMEARecordData` Components of a SMIMEA record. - `Certificate string` Certificate. - `MatchingType float64` Matching Type. - `Selector float64` Selector. - `Usage float64` Usage. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings SMIMEARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type SRVRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type SRVRecordType` Record type. - `const SRVRecordTypeSRV SRVRecordType = "SRV"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Priority, weight, port, and SRV target. See 'data' for setting the individual component values. - `Data SRVRecordData` Components of a SRV record. - `Port float64` The port of the service. - `Priority float64` Required for MX and URI records; ignored for other record types (but may still be returned by the API). Records with lower priorities are preferred. This field is to be deprecated in favor of the priority field within the data map. - `Target string` A valid hostname. - `Weight float64` The record weight. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings SRVRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type SSHFPRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type SSHFPRecordType` Record type. - `const SSHFPRecordTypeSSHFP SSHFPRecordType = "SSHFP"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted SSHFP content. See 'data' to set SSHFP properties. - `Data SSHFPRecordData` Components of a SSHFP record. - `Algorithm float64` Algorithm. - `Fingerprint string` Fingerprint. - `Type float64` Type. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings SSHFPRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type SVCBRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type SVCBRecordType` Record type. - `const SVCBRecordTypeSVCB SVCBRecordType = "SVCB"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted SVCB content. See 'data' to set SVCB properties. - `Data SVCBRecordData` Components of a SVCB record. - `Priority float64` Priority. - `Target string` Target. - `Value string` Value. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings SVCBRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type TLSARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type TLSARecordType` Record type. - `const TLSARecordTypeTLSA TLSARecordType = "TLSA"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted TLSA content. See 'data' to set TLSA properties. - `Data TLSARecordData` Components of a TLSA record. - `Certificate string` Certificate. - `MatchingType float64` Matching Type. - `Selector float64` Selector. - `Usage float64` Usage. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings TLSARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type URIRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type URIRecordType` Record type. - `const URIRecordTypeURI URIRecordType = "URI"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted URI content. See 'data' to set URI properties. - `Data URIRecordData` Components of a URI record. - `Target string` The record content. - `Weight float64` The record weight. - `Priority float64` Required for MX and URI records; ignored for other record types (but may still be returned by the API). Records with lower priorities are preferred. This field is to be deprecated in favor of the priority field within the data map. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings URIRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `Rejects param.Field[[]RecordScanReviewParamsReject]` Body param - `ID string` Identifier. ### Returns - `type RecordScanReviewResponse struct{…}` - `Accepts []RecordResponse` - `type RecordResponseA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseAAAA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCNAME struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseMX struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseNS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseOpenpgpkey struct{…}` - `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) - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Name string` Complete DNS record name, including the zone name, in Punycode. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings RecordResponseOpenpgpkeySettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` 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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type RecordResponseOpenpgpkeyType` Record type. - `const RecordResponseOpenpgpkeyTypeOpenpgpkey RecordResponseOpenpgpkeyType = "OPENPGPKEY"` - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponsePTR struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseTXT struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCAA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCERT struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseDNSKEY struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseDS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseHTTPS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseLOC struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseNAPTR struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSMIMEA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSRV struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSSHFP struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSVCB struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseTLSA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseURI struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `Rejects []string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DNS.Records.ScanReview(context.TODO(), dns.RecordScanReviewParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Accepts) } ``` #### 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": { "accepts": [ { "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" } ], "rejects": [ "023e105f4ecef8ad9ca31a8372d0c353" ] } } ``` ## List Scanned DNS Records `client.DNS.Records.ScanList(ctx, query) (*SinglePage[RecordResponse], error)` **get** `/zones/{zone_id}/dns_records/scan/review` Retrieves the list of DNS records discovered up to this point by the asynchronous scan. These records are temporary until explicitly accepted or rejected via `POST /scan/review`. Additional records may be discovered by the scan later. ### Parameters - `query RecordScanListParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type RecordResponse interface{…}` - `type RecordResponseA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseAAAA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCNAME struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseMX struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseNS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseOpenpgpkey struct{…}` - `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) - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Name string` Complete DNS record name, including the zone name, in Punycode. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings RecordResponseOpenpgpkeySettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` 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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type RecordResponseOpenpgpkeyType` Record type. - `const RecordResponseOpenpgpkeyTypeOpenpgpkey RecordResponseOpenpgpkeyType = "OPENPGPKEY"` - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponsePTR struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseTXT struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCAA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCERT struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseDNSKEY struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseDS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseHTTPS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseLOC struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseNAPTR struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSMIMEA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSRV struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSSHFP struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSVCB struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseTLSA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseURI struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.DNS.Records.ScanList(context.TODO(), dns.RecordScanListParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### 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 } } ``` ## Batch DNS Records `client.DNS.Records.Batch(ctx, params) (*RecordBatchResponse, error)` **post** `/zones/{zone_id}/dns_records/batch` Send a Batch of DNS Record API calls to be executed together. Notes: - Although Cloudflare will execute the batched operations in a single database transaction, Cloudflare's distributed KV store must treat each record change as a single key-value pair. This means that the propagation of changes is not atomic. See [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/batch-record-changes/ "Batch DNS records") for more information. - The operations you specify within the /batch request body are always executed in the following order: - Deletes - Patches - Puts - Posts ### Parameters - `params RecordBatchParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Deletes param.Field[[]RecordBatchParamsDelete]` Body param - `ID string` Identifier. - `Patches param.Field[[]BatchPatch]` Body param - `BatchPatchARecord` - `ID string` Identifier. - `BatchPatchAAAARecord` - `ID string` Identifier. - `BatchPatchCNAMERecord` - `ID string` Identifier. - `BatchPatchMXRecord` - `ID string` Identifier. - `BatchPatchNSRecord` - `ID string` Identifier. - `BatchPatchOpenpgpkeyRecord` - `ID string` Identifier. - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type BatchPatchOpenpgpkeyRecordType` Record type. - `const BatchPatchOpenpgpkeyRecordTypeOpenpgpkey BatchPatchOpenpgpkeyRecordType = "OPENPGPKEY"` - `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) - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings BatchPatchOpenpgpkeyRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `BatchPatchPTRRecord` - `ID string` Identifier. - `BatchPatchTXTRecord` - `ID string` Identifier. - `BatchPatchCAARecord` - `ID string` Identifier. - `BatchPatchCERTRecord` - `ID string` Identifier. - `BatchPatchDNSKEYRecord` - `ID string` Identifier. - `BatchPatchDSRecord` - `ID string` Identifier. - `BatchPatchHTTPSRecord` - `ID string` Identifier. - `BatchPatchLOCRecord` - `ID string` Identifier. - `BatchPatchNAPTRRecord` - `ID string` Identifier. - `BatchPatchSMIMEARecord` - `ID string` Identifier. - `BatchPatchSRVRecord` - `ID string` Identifier. - `BatchPatchSSHFPRecord` - `ID string` Identifier. - `BatchPatchSVCBRecord` - `ID string` Identifier. - `BatchPatchTLSARecord` - `ID string` Identifier. - `BatchPatchURIRecord` - `ID string` Identifier. - `Posts param.Field[[]RecordBatchParamsPost]` Body param - `type ARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type ARecordType` Record type. - `const ARecordTypeA ARecordType = "A"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid IPv4 address. - `PrivateRouting bool` Enables private network routing to the origin. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings ARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type AAAARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type AAAARecordType` Record type. - `const AAAARecordTypeAAAA AAAARecordType = "AAAA"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid IPv6 address. - `PrivateRouting bool` Enables private network routing to the origin. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings AAAARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type CNAMERecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type CNAMERecordType` Record type. - `const CNAMERecordTypeCNAME CNAMERecordType = "CNAME"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid hostname. Must not match the record's name. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings CNAMERecordSettings` Settings for the DNS record. - `FlattenCNAME bool` If enabled, causes the CNAME record to be resolved externally and the resulting address records (e.g., A and AAAA) to be returned instead of the CNAME record itself. This setting is unavailable for proxied records, since they are always flattened. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type MXRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type MXRecordType` Record type. - `const MXRecordTypeMX MXRecordType = "MX"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid mail server hostname. - `Priority float64` Required for MX and URI records; ignored for other record types (but may still be returned by the API). Records with lower priorities are preferred. This field is to be deprecated in favor of the priority field within the data map. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings MXRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type NSRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type NSRecordType` Record type. - `const NSRecordTypeNS NSRecordType = "NS"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid name server host name. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings NSRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type RecordBatchParamsPostsDNSRecordsOpenpgpkeyRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type RecordBatchParamsPostsDNSRecordsOpenpgpkeyRecordType` Record type. - `const RecordBatchParamsPostsDNSRecordsOpenpgpkeyRecordTypeOpenpgpkey RecordBatchParamsPostsDNSRecordsOpenpgpkeyRecordType = "OPENPGPKEY"` - `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) - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings RecordBatchParamsPostsDNSRecordsOpenpgpkeyRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type PTRRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type PTRRecordType` Record type. - `const PTRRecordTypePTR PTRRecordType = "PTR"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Domain name pointing to the address. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings PTRRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type TXTRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type TXTRecordType` Record type. - `const TXTRecordTypeTXT TXTRecordType = "TXT"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Text content for the record. The content must consist of quoted "character strings" (RFC 1035), each with a length of up to 255 bytes. Strings exceeding this allowed maximum length are automatically split. Learn more at . - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings TXTRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type CAARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type CAARecordType` Record type. - `const CAARecordTypeCAA CAARecordType = "CAA"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted CAA content. See 'data' to set CAA properties. - `Data CAARecordData` Components of a CAA record. - `Flags float64` Flags for the CAA record. - `Tag string` Name of the property controlled by this record (e.g.: issue, issuewild, iodef). - `Value string` Value of the record. This field's semantics depend on the chosen tag. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings CAARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type CERTRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type CERTRecordType` Record type. - `const CERTRecordTypeCERT CERTRecordType = "CERT"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted CERT content. See 'data' to set CERT properties. - `Data CERTRecordData` Components of a CERT record. - `Algorithm float64` Algorithm. - `Certificate string` Certificate. - `KeyTag float64` Key Tag. - `Type float64` Type. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings CERTRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type DNSKEYRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type DNSKEYRecordType` Record type. - `const DNSKEYRecordTypeDNSKEY DNSKEYRecordType = "DNSKEY"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted DNSKEY content. See 'data' to set DNSKEY properties. - `Data DNSKEYRecordData` Components of a DNSKEY record. - `Algorithm float64` Algorithm. - `Flags float64` Flags. - `Protocol float64` Protocol. - `PublicKey string` Public Key. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings DNSKEYRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type DSRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type DSRecordType` Record type. - `const DSRecordTypeDS DSRecordType = "DS"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted DS content. See 'data' to set DS properties. - `Data DSRecordData` Components of a DS record. - `Algorithm float64` Algorithm. - `Digest string` Digest. - `DigestType float64` Digest Type. - `KeyTag float64` Key Tag. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings DSRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type HTTPSRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type HTTPSRecordType` Record type. - `const HTTPSRecordTypeHTTPS HTTPSRecordType = "HTTPS"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted HTTPS content. See 'data' to set HTTPS properties. - `Data HTTPSRecordData` Components of a HTTPS record. - `Priority float64` Priority. - `Target string` Target. - `Value string` Value. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings HTTPSRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type LOCRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type LOCRecordType` Record type. - `const LOCRecordTypeLOC LOCRecordType = "LOC"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted LOC content. See 'data' to set LOC properties. - `Data LOCRecordData` Components of a LOC record. - `Altitude float64` Altitude of location in meters. - `LatDegrees float64` Degrees of latitude. - `LatDirection LOCRecordDataLatDirection` Latitude direction. - `const LOCRecordDataLatDirectionN LOCRecordDataLatDirection = "N"` - `const LOCRecordDataLatDirectionS LOCRecordDataLatDirection = "S"` - `LatMinutes float64` Minutes of latitude. - `LatSeconds float64` Seconds of latitude. - `LongDegrees float64` Degrees of longitude. - `LongDirection LOCRecordDataLongDirection` Longitude direction. - `const LOCRecordDataLongDirectionE LOCRecordDataLongDirection = "E"` - `const LOCRecordDataLongDirectionW LOCRecordDataLongDirection = "W"` - `LongMinutes float64` Minutes of longitude. - `LongSeconds float64` Seconds of longitude. - `PrecisionHorz float64` Horizontal precision of location. - `PrecisionVert float64` Vertical precision of location. - `Size float64` Size of location in meters. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings LOCRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type NAPTRRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type NAPTRRecordType` Record type. - `const NAPTRRecordTypeNAPTR NAPTRRecordType = "NAPTR"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted NAPTR content. See 'data' to set NAPTR properties. - `Data NAPTRRecordData` Components of a NAPTR record. - `Flags string` Flags. - `Order float64` Order. - `Preference float64` Preference. - `Regex string` Regex. - `Replacement string` Replacement. - `Service string` Service. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings NAPTRRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type SMIMEARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type SMIMEARecordType` Record type. - `const SMIMEARecordTypeSMIMEA SMIMEARecordType = "SMIMEA"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted SMIMEA content. See 'data' to set SMIMEA properties. - `Data SMIMEARecordData` Components of a SMIMEA record. - `Certificate string` Certificate. - `MatchingType float64` Matching Type. - `Selector float64` Selector. - `Usage float64` Usage. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings SMIMEARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type SRVRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type SRVRecordType` Record type. - `const SRVRecordTypeSRV SRVRecordType = "SRV"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Priority, weight, port, and SRV target. See 'data' for setting the individual component values. - `Data SRVRecordData` Components of a SRV record. - `Port float64` The port of the service. - `Priority float64` Required for MX and URI records; ignored for other record types (but may still be returned by the API). Records with lower priorities are preferred. This field is to be deprecated in favor of the priority field within the data map. - `Target string` A valid hostname. - `Weight float64` The record weight. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings SRVRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type SSHFPRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type SSHFPRecordType` Record type. - `const SSHFPRecordTypeSSHFP SSHFPRecordType = "SSHFP"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted SSHFP content. See 'data' to set SSHFP properties. - `Data SSHFPRecordData` Components of a SSHFP record. - `Algorithm float64` Algorithm. - `Fingerprint string` Fingerprint. - `Type float64` Type. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings SSHFPRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type SVCBRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type SVCBRecordType` Record type. - `const SVCBRecordTypeSVCB SVCBRecordType = "SVCB"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted SVCB content. See 'data' to set SVCB properties. - `Data SVCBRecordData` Components of a SVCB record. - `Priority float64` Priority. - `Target string` Target. - `Value string` Value. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings SVCBRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type TLSARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type TLSARecordType` Record type. - `const TLSARecordTypeTLSA TLSARecordType = "TLSA"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted TLSA content. See 'data' to set TLSA properties. - `Data TLSARecordData` Components of a TLSA record. - `Certificate string` Certificate. - `MatchingType float64` Matching Type. - `Selector float64` Selector. - `Usage float64` Usage. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings TLSARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type URIRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type URIRecordType` Record type. - `const URIRecordTypeURI URIRecordType = "URI"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted URI content. See 'data' to set URI properties. - `Data URIRecordData` Components of a URI record. - `Target string` The record content. - `Weight float64` The record weight. - `Priority float64` Required for MX and URI records; ignored for other record types (but may still be returned by the API). Records with lower priorities are preferred. This field is to be deprecated in favor of the priority field within the data map. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings URIRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `Puts param.Field[[]BatchPut]` Body param - `BatchPutARecord` - `ID string` Identifier. - `BatchPutAAAARecord` - `ID string` Identifier. - `BatchPutCNAMERecord` - `ID string` Identifier. - `BatchPutMXRecord` - `ID string` Identifier. - `BatchPutNSRecord` - `ID string` Identifier. - `BatchPutOpenpgpkeyRecord` - `ID string` Identifier. - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type BatchPutOpenpgpkeyRecordType` Record type. - `const BatchPutOpenpgpkeyRecordTypeOpenpgpkey BatchPutOpenpgpkeyRecordType = "OPENPGPKEY"` - `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) - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings BatchPutOpenpgpkeyRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `BatchPutPTRRecord` - `ID string` Identifier. - `BatchPutTXTRecord` - `ID string` Identifier. - `BatchPutCAARecord` - `ID string` Identifier. - `BatchPutCERTRecord` - `ID string` Identifier. - `BatchPutDNSKEYRecord` - `ID string` Identifier. - `BatchPutDSRecord` - `ID string` Identifier. - `BatchPutHTTPSRecord` - `ID string` Identifier. - `BatchPutLOCRecord` - `ID string` Identifier. - `BatchPutNAPTRRecord` - `ID string` Identifier. - `BatchPutSMIMEARecord` - `ID string` Identifier. - `BatchPutSRVRecord` - `ID string` Identifier. - `BatchPutSSHFPRecord` - `ID string` Identifier. - `BatchPutSVCBRecord` - `ID string` Identifier. - `BatchPutTLSARecord` - `ID string` Identifier. - `BatchPutURIRecord` - `ID string` Identifier. ### Returns - `type RecordBatchResponse struct{…}` - `Deletes []RecordResponse` - `type RecordResponseA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseAAAA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCNAME struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseMX struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseNS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseOpenpgpkey struct{…}` - `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) - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Name string` Complete DNS record name, including the zone name, in Punycode. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings RecordResponseOpenpgpkeySettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` 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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type RecordResponseOpenpgpkeyType` Record type. - `const RecordResponseOpenpgpkeyTypeOpenpgpkey RecordResponseOpenpgpkeyType = "OPENPGPKEY"` - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponsePTR struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseTXT struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCAA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCERT struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseDNSKEY struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseDS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseHTTPS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseLOC struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseNAPTR struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSMIMEA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSRV struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSSHFP struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSVCB struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseTLSA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseURI struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `Patches []RecordResponse` - `type RecordResponseA struct{…}` - `type RecordResponseAAAA struct{…}` - `type RecordResponseCNAME struct{…}` - `type RecordResponseMX struct{…}` - `type RecordResponseNS struct{…}` - `type RecordResponseOpenpgpkey struct{…}` - `type RecordResponsePTR struct{…}` - `type RecordResponseTXT struct{…}` - `type RecordResponseCAA struct{…}` - `type RecordResponseCERT struct{…}` - `type RecordResponseDNSKEY struct{…}` - `type RecordResponseDS struct{…}` - `type RecordResponseHTTPS struct{…}` - `type RecordResponseLOC struct{…}` - `type RecordResponseNAPTR struct{…}` - `type RecordResponseSMIMEA struct{…}` - `type RecordResponseSRV struct{…}` - `type RecordResponseSSHFP struct{…}` - `type RecordResponseSVCB struct{…}` - `type RecordResponseTLSA struct{…}` - `type RecordResponseURI struct{…}` - `Posts []RecordResponse` - `type RecordResponseA struct{…}` - `type RecordResponseAAAA struct{…}` - `type RecordResponseCNAME struct{…}` - `type RecordResponseMX struct{…}` - `type RecordResponseNS struct{…}` - `type RecordResponseOpenpgpkey struct{…}` - `type RecordResponsePTR struct{…}` - `type RecordResponseTXT struct{…}` - `type RecordResponseCAA struct{…}` - `type RecordResponseCERT struct{…}` - `type RecordResponseDNSKEY struct{…}` - `type RecordResponseDS struct{…}` - `type RecordResponseHTTPS struct{…}` - `type RecordResponseLOC struct{…}` - `type RecordResponseNAPTR struct{…}` - `type RecordResponseSMIMEA struct{…}` - `type RecordResponseSRV struct{…}` - `type RecordResponseSSHFP struct{…}` - `type RecordResponseSVCB struct{…}` - `type RecordResponseTLSA struct{…}` - `type RecordResponseURI struct{…}` - `Puts []RecordResponse` - `type RecordResponseA struct{…}` - `type RecordResponseAAAA struct{…}` - `type RecordResponseCNAME struct{…}` - `type RecordResponseMX struct{…}` - `type RecordResponseNS struct{…}` - `type RecordResponseOpenpgpkey struct{…}` - `type RecordResponsePTR struct{…}` - `type RecordResponseTXT struct{…}` - `type RecordResponseCAA struct{…}` - `type RecordResponseCERT struct{…}` - `type RecordResponseDNSKEY struct{…}` - `type RecordResponseDS struct{…}` - `type RecordResponseHTTPS struct{…}` - `type RecordResponseLOC struct{…}` - `type RecordResponseNAPTR struct{…}` - `type RecordResponseSMIMEA struct{…}` - `type RecordResponseSRV struct{…}` - `type RecordResponseSSHFP struct{…}` - `type RecordResponseSVCB struct{…}` - `type RecordResponseTLSA struct{…}` - `type RecordResponseURI struct{…}` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DNS.Records.Batch(context.TODO(), dns.RecordBatchParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Deletes) } ``` #### 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": { "deletes": [ { "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" } ], "patches": [ { "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" } ], "posts": [ { "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" } ], "puts": [ { "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" } ] } } ``` ## Domain Types ### A Record - `type ARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type ARecordType` Record type. - `const ARecordTypeA ARecordType = "A"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid IPv4 address. - `PrivateRouting bool` Enables private network routing to the origin. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings ARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### AAAA Record - `type AAAARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type AAAARecordType` Record type. - `const AAAARecordTypeAAAA AAAARecordType = "AAAA"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid IPv6 address. - `PrivateRouting bool` Enables private network routing to the origin. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings AAAARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### Batch Patch - `type BatchPatch interface{…}` - `BatchPatchARecord` - `ID string` Identifier. - `BatchPatchAAAARecord` - `ID string` Identifier. - `BatchPatchCNAMERecord` - `ID string` Identifier. - `BatchPatchMXRecord` - `ID string` Identifier. - `BatchPatchNSRecord` - `ID string` Identifier. - `BatchPatchOpenpgpkeyRecord` - `ID string` Identifier. - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type BatchPatchOpenpgpkeyRecordType` Record type. - `const BatchPatchOpenpgpkeyRecordTypeOpenpgpkey BatchPatchOpenpgpkeyRecordType = "OPENPGPKEY"` - `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) - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings BatchPatchOpenpgpkeyRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `BatchPatchPTRRecord` - `ID string` Identifier. - `BatchPatchTXTRecord` - `ID string` Identifier. - `BatchPatchCAARecord` - `ID string` Identifier. - `BatchPatchCERTRecord` - `ID string` Identifier. - `BatchPatchDNSKEYRecord` - `ID string` Identifier. - `BatchPatchDSRecord` - `ID string` Identifier. - `BatchPatchHTTPSRecord` - `ID string` Identifier. - `BatchPatchLOCRecord` - `ID string` Identifier. - `BatchPatchNAPTRRecord` - `ID string` Identifier. - `BatchPatchSMIMEARecord` - `ID string` Identifier. - `BatchPatchSRVRecord` - `ID string` Identifier. - `BatchPatchSSHFPRecord` - `ID string` Identifier. - `BatchPatchSVCBRecord` - `ID string` Identifier. - `BatchPatchTLSARecord` - `ID string` Identifier. - `BatchPatchURIRecord` - `ID string` Identifier. ### Batch Put - `type BatchPut interface{…}` - `BatchPutARecord` - `ID string` Identifier. - `BatchPutAAAARecord` - `ID string` Identifier. - `BatchPutCNAMERecord` - `ID string` Identifier. - `BatchPutMXRecord` - `ID string` Identifier. - `BatchPutNSRecord` - `ID string` Identifier. - `BatchPutOpenpgpkeyRecord` - `ID string` Identifier. - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type BatchPutOpenpgpkeyRecordType` Record type. - `const BatchPutOpenpgpkeyRecordTypeOpenpgpkey BatchPutOpenpgpkeyRecordType = "OPENPGPKEY"` - `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) - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings BatchPutOpenpgpkeyRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `BatchPutPTRRecord` - `ID string` Identifier. - `BatchPutTXTRecord` - `ID string` Identifier. - `BatchPutCAARecord` - `ID string` Identifier. - `BatchPutCERTRecord` - `ID string` Identifier. - `BatchPutDNSKEYRecord` - `ID string` Identifier. - `BatchPutDSRecord` - `ID string` Identifier. - `BatchPutHTTPSRecord` - `ID string` Identifier. - `BatchPutLOCRecord` - `ID string` Identifier. - `BatchPutNAPTRRecord` - `ID string` Identifier. - `BatchPutSMIMEARecord` - `ID string` Identifier. - `BatchPutSRVRecord` - `ID string` Identifier. - `BatchPutSSHFPRecord` - `ID string` Identifier. - `BatchPutSVCBRecord` - `ID string` Identifier. - `BatchPutTLSARecord` - `ID string` Identifier. - `BatchPutURIRecord` - `ID string` Identifier. ### CAA Record - `type CAARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type CAARecordType` Record type. - `const CAARecordTypeCAA CAARecordType = "CAA"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted CAA content. See 'data' to set CAA properties. - `Data CAARecordData` Components of a CAA record. - `Flags float64` Flags for the CAA record. - `Tag string` Name of the property controlled by this record (e.g.: issue, issuewild, iodef). - `Value string` Value of the record. This field's semantics depend on the chosen tag. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings CAARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### CERT Record - `type CERTRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type CERTRecordType` Record type. - `const CERTRecordTypeCERT CERTRecordType = "CERT"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted CERT content. See 'data' to set CERT properties. - `Data CERTRecordData` Components of a CERT record. - `Algorithm float64` Algorithm. - `Certificate string` Certificate. - `KeyTag float64` Key Tag. - `Type float64` Type. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings CERTRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### CNAME Record - `type CNAMERecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type CNAMERecordType` Record type. - `const CNAMERecordTypeCNAME CNAMERecordType = "CNAME"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid hostname. Must not match the record's name. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings CNAMERecordSettings` Settings for the DNS record. - `FlattenCNAME bool` If enabled, causes the CNAME record to be resolved externally and the resulting address records (e.g., A and AAAA) to be returned instead of the CNAME record itself. This setting is unavailable for proxied records, since they are always flattened. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### DNSKEY Record - `type DNSKEYRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type DNSKEYRecordType` Record type. - `const DNSKEYRecordTypeDNSKEY DNSKEYRecordType = "DNSKEY"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted DNSKEY content. See 'data' to set DNSKEY properties. - `Data DNSKEYRecordData` Components of a DNSKEY record. - `Algorithm float64` Algorithm. - `Flags float64` Flags. - `Protocol float64` Protocol. - `PublicKey string` Public Key. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings DNSKEYRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### DS Record - `type DSRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type DSRecordType` Record type. - `const DSRecordTypeDS DSRecordType = "DS"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted DS content. See 'data' to set DS properties. - `Data DSRecordData` Components of a DS record. - `Algorithm float64` Algorithm. - `Digest string` Digest. - `DigestType float64` Digest Type. - `KeyTag float64` Key Tag. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings DSRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### HTTPS Record - `type HTTPSRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type HTTPSRecordType` Record type. - `const HTTPSRecordTypeHTTPS HTTPSRecordType = "HTTPS"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted HTTPS content. See 'data' to set HTTPS properties. - `Data HTTPSRecordData` Components of a HTTPS record. - `Priority float64` Priority. - `Target string` Target. - `Value string` Value. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings HTTPSRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### LOC Record - `type LOCRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type LOCRecordType` Record type. - `const LOCRecordTypeLOC LOCRecordType = "LOC"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted LOC content. See 'data' to set LOC properties. - `Data LOCRecordData` Components of a LOC record. - `Altitude float64` Altitude of location in meters. - `LatDegrees float64` Degrees of latitude. - `LatDirection LOCRecordDataLatDirection` Latitude direction. - `const LOCRecordDataLatDirectionN LOCRecordDataLatDirection = "N"` - `const LOCRecordDataLatDirectionS LOCRecordDataLatDirection = "S"` - `LatMinutes float64` Minutes of latitude. - `LatSeconds float64` Seconds of latitude. - `LongDegrees float64` Degrees of longitude. - `LongDirection LOCRecordDataLongDirection` Longitude direction. - `const LOCRecordDataLongDirectionE LOCRecordDataLongDirection = "E"` - `const LOCRecordDataLongDirectionW LOCRecordDataLongDirection = "W"` - `LongMinutes float64` Minutes of longitude. - `LongSeconds float64` Seconds of longitude. - `PrecisionHorz float64` Horizontal precision of location. - `PrecisionVert float64` Vertical precision of location. - `Size float64` Size of location in meters. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings LOCRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### MX Record - `type MXRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type MXRecordType` Record type. - `const MXRecordTypeMX MXRecordType = "MX"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid mail server hostname. - `Priority float64` Required for MX and URI records; ignored for other record types (but may still be returned by the API). Records with lower priorities are preferred. This field is to be deprecated in favor of the priority field within the data map. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings MXRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### NAPTR Record - `type NAPTRRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type NAPTRRecordType` Record type. - `const NAPTRRecordTypeNAPTR NAPTRRecordType = "NAPTR"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted NAPTR content. See 'data' to set NAPTR properties. - `Data NAPTRRecordData` Components of a NAPTR record. - `Flags string` Flags. - `Order float64` Order. - `Preference float64` Preference. - `Regex string` Regex. - `Replacement string` Replacement. - `Service string` Service. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings NAPTRRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### NS Record - `type NSRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type NSRecordType` Record type. - `const NSRecordTypeNS NSRecordType = "NS"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid name server host name. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings NSRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### PTR Record - `type PTRRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type PTRRecordType` Record type. - `const PTRRecordTypePTR PTRRecordType = "PTR"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Domain name pointing to the address. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings PTRRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### Record - `type Record interface{…}` - `type ARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type ARecordType` Record type. - `const ARecordTypeA ARecordType = "A"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid IPv4 address. - `PrivateRouting bool` Enables private network routing to the origin. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings ARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type AAAARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type AAAARecordType` Record type. - `const AAAARecordTypeAAAA AAAARecordType = "AAAA"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid IPv6 address. - `PrivateRouting bool` Enables private network routing to the origin. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings AAAARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type CNAMERecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type CNAMERecordType` Record type. - `const CNAMERecordTypeCNAME CNAMERecordType = "CNAME"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid hostname. Must not match the record's name. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings CNAMERecordSettings` Settings for the DNS record. - `FlattenCNAME bool` If enabled, causes the CNAME record to be resolved externally and the resulting address records (e.g., A and AAAA) to be returned instead of the CNAME record itself. This setting is unavailable for proxied records, since they are always flattened. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type MXRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type MXRecordType` Record type. - `const MXRecordTypeMX MXRecordType = "MX"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid mail server hostname. - `Priority float64` Required for MX and URI records; ignored for other record types (but may still be returned by the API). Records with lower priorities are preferred. This field is to be deprecated in favor of the priority field within the data map. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings MXRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type NSRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type NSRecordType` Record type. - `const NSRecordTypeNS NSRecordType = "NS"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` A valid name server host name. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings NSRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `RecordOpenpgpkey` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type RecordOpenpgpkeyType` Record type. - `const RecordOpenpgpkeyTypeOpenpgpkey RecordOpenpgpkeyType = "OPENPGPKEY"` - `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) - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings RecordOpenpgpkeySettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type PTRRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type PTRRecordType` Record type. - `const PTRRecordTypePTR PTRRecordType = "PTR"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Domain name pointing to the address. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings PTRRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type TXTRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type TXTRecordType` Record type. - `const TXTRecordTypeTXT TXTRecordType = "TXT"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Text content for the record. The content must consist of quoted "character strings" (RFC 1035), each with a length of up to 255 bytes. Strings exceeding this allowed maximum length are automatically split. Learn more at . - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings TXTRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type CAARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type CAARecordType` Record type. - `const CAARecordTypeCAA CAARecordType = "CAA"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted CAA content. See 'data' to set CAA properties. - `Data CAARecordData` Components of a CAA record. - `Flags float64` Flags for the CAA record. - `Tag string` Name of the property controlled by this record (e.g.: issue, issuewild, iodef). - `Value string` Value of the record. This field's semantics depend on the chosen tag. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings CAARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type CERTRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type CERTRecordType` Record type. - `const CERTRecordTypeCERT CERTRecordType = "CERT"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted CERT content. See 'data' to set CERT properties. - `Data CERTRecordData` Components of a CERT record. - `Algorithm float64` Algorithm. - `Certificate string` Certificate. - `KeyTag float64` Key Tag. - `Type float64` Type. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings CERTRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type DNSKEYRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type DNSKEYRecordType` Record type. - `const DNSKEYRecordTypeDNSKEY DNSKEYRecordType = "DNSKEY"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted DNSKEY content. See 'data' to set DNSKEY properties. - `Data DNSKEYRecordData` Components of a DNSKEY record. - `Algorithm float64` Algorithm. - `Flags float64` Flags. - `Protocol float64` Protocol. - `PublicKey string` Public Key. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings DNSKEYRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type DSRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type DSRecordType` Record type. - `const DSRecordTypeDS DSRecordType = "DS"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted DS content. See 'data' to set DS properties. - `Data DSRecordData` Components of a DS record. - `Algorithm float64` Algorithm. - `Digest string` Digest. - `DigestType float64` Digest Type. - `KeyTag float64` Key Tag. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings DSRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type HTTPSRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type HTTPSRecordType` Record type. - `const HTTPSRecordTypeHTTPS HTTPSRecordType = "HTTPS"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted HTTPS content. See 'data' to set HTTPS properties. - `Data HTTPSRecordData` Components of a HTTPS record. - `Priority float64` Priority. - `Target string` Target. - `Value string` Value. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings HTTPSRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type LOCRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type LOCRecordType` Record type. - `const LOCRecordTypeLOC LOCRecordType = "LOC"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted LOC content. See 'data' to set LOC properties. - `Data LOCRecordData` Components of a LOC record. - `Altitude float64` Altitude of location in meters. - `LatDegrees float64` Degrees of latitude. - `LatDirection LOCRecordDataLatDirection` Latitude direction. - `const LOCRecordDataLatDirectionN LOCRecordDataLatDirection = "N"` - `const LOCRecordDataLatDirectionS LOCRecordDataLatDirection = "S"` - `LatMinutes float64` Minutes of latitude. - `LatSeconds float64` Seconds of latitude. - `LongDegrees float64` Degrees of longitude. - `LongDirection LOCRecordDataLongDirection` Longitude direction. - `const LOCRecordDataLongDirectionE LOCRecordDataLongDirection = "E"` - `const LOCRecordDataLongDirectionW LOCRecordDataLongDirection = "W"` - `LongMinutes float64` Minutes of longitude. - `LongSeconds float64` Seconds of longitude. - `PrecisionHorz float64` Horizontal precision of location. - `PrecisionVert float64` Vertical precision of location. - `Size float64` Size of location in meters. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings LOCRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type NAPTRRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type NAPTRRecordType` Record type. - `const NAPTRRecordTypeNAPTR NAPTRRecordType = "NAPTR"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted NAPTR content. See 'data' to set NAPTR properties. - `Data NAPTRRecordData` Components of a NAPTR record. - `Flags string` Flags. - `Order float64` Order. - `Preference float64` Preference. - `Regex string` Regex. - `Replacement string` Replacement. - `Service string` Service. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings NAPTRRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type SMIMEARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type SMIMEARecordType` Record type. - `const SMIMEARecordTypeSMIMEA SMIMEARecordType = "SMIMEA"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted SMIMEA content. See 'data' to set SMIMEA properties. - `Data SMIMEARecordData` Components of a SMIMEA record. - `Certificate string` Certificate. - `MatchingType float64` Matching Type. - `Selector float64` Selector. - `Usage float64` Usage. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings SMIMEARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type SRVRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type SRVRecordType` Record type. - `const SRVRecordTypeSRV SRVRecordType = "SRV"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Priority, weight, port, and SRV target. See 'data' for setting the individual component values. - `Data SRVRecordData` Components of a SRV record. - `Port float64` The port of the service. - `Priority float64` Required for MX and URI records; ignored for other record types (but may still be returned by the API). Records with lower priorities are preferred. This field is to be deprecated in favor of the priority field within the data map. - `Target string` A valid hostname. - `Weight float64` The record weight. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings SRVRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type SSHFPRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type SSHFPRecordType` Record type. - `const SSHFPRecordTypeSSHFP SSHFPRecordType = "SSHFP"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted SSHFP content. See 'data' to set SSHFP properties. - `Data SSHFPRecordData` Components of a SSHFP record. - `Algorithm float64` Algorithm. - `Fingerprint string` Fingerprint. - `Type float64` Type. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings SSHFPRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type SVCBRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type SVCBRecordType` Record type. - `const SVCBRecordTypeSVCB SVCBRecordType = "SVCB"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted SVCB content. See 'data' to set SVCB properties. - `Data SVCBRecordData` Components of a SVCB record. - `Priority float64` Priority. - `Target string` Target. - `Value string` Value. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings SVCBRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type TLSARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type TLSARecordType` Record type. - `const TLSARecordTypeTLSA TLSARecordType = "TLSA"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted TLSA content. See 'data' to set TLSA properties. - `Data TLSARecordData` Components of a TLSA record. - `Certificate string` Certificate. - `MatchingType float64` Matching Type. - `Selector float64` Selector. - `Usage float64` Usage. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings TLSARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. - `type URIRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `Type URIRecordType` Record type. - `const URIRecordTypeURI URIRecordType = "URI"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted URI content. See 'data' to set URI properties. - `Data URIRecordData` Components of a URI record. - `Target string` The record content. - `Weight float64` The record weight. - `Priority float64` Required for MX and URI records; ignored for other record types (but may still be returned by the API). Records with lower priorities are preferred. This field is to be deprecated in favor of the priority field within the data map. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings URIRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### Record Response - `type RecordResponse interface{…}` - `type RecordResponseA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseAAAA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCNAME struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseMX struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseNS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseOpenpgpkey struct{…}` - `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) - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Name string` Complete DNS record name, including the zone name, in Punycode. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings RecordResponseOpenpgpkeySettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` 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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type RecordResponseOpenpgpkeyType` Record type. - `const RecordResponseOpenpgpkeyTypeOpenpgpkey RecordResponseOpenpgpkeyType = "OPENPGPKEY"` - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponsePTR struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseTXT struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCAA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseCERT struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseDNSKEY struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseDS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseHTTPS struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseLOC struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseNAPTR struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSMIMEA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSRV struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSSHFP struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseSVCB struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseTLSA struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. - `type RecordResponseURI struct{…}` - `ID string` Identifier. - `CreatedOn Time` When the record was created. - `Meta unknown` Extra Cloudflare-specific information about the record. - `ModifiedOn Time` When the record was last modified. - `Proxiable bool` Whether the record can be proxied by Cloudflare or not. - `CommentModifiedOn Time` When the record comment was last modified. Omitted if there is no comment. - `TagsModifiedOn Time` When the record tags were last modified. Omitted if there are no tags. ### Record Tags - `type RecordTags string` Individual tag of the form name:value (the name must consist of only letters, numbers, underscores and hyphens) ### SMIMEA Record - `type SMIMEARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type SMIMEARecordType` Record type. - `const SMIMEARecordTypeSMIMEA SMIMEARecordType = "SMIMEA"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted SMIMEA content. See 'data' to set SMIMEA properties. - `Data SMIMEARecordData` Components of a SMIMEA record. - `Certificate string` Certificate. - `MatchingType float64` Matching Type. - `Selector float64` Selector. - `Usage float64` Usage. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings SMIMEARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### SRV Record - `type SRVRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type SRVRecordType` Record type. - `const SRVRecordTypeSRV SRVRecordType = "SRV"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Priority, weight, port, and SRV target. See 'data' for setting the individual component values. - `Data SRVRecordData` Components of a SRV record. - `Port float64` The port of the service. - `Priority float64` Required for MX and URI records; ignored for other record types (but may still be returned by the API). Records with lower priorities are preferred. This field is to be deprecated in favor of the priority field within the data map. - `Target string` A valid hostname. - `Weight float64` The record weight. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings SRVRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### SSHFP Record - `type SSHFPRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type SSHFPRecordType` Record type. - `const SSHFPRecordTypeSSHFP SSHFPRecordType = "SSHFP"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted SSHFP content. See 'data' to set SSHFP properties. - `Data SSHFPRecordData` Components of a SSHFP record. - `Algorithm float64` Algorithm. - `Fingerprint string` Fingerprint. - `Type float64` Type. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings SSHFPRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### SVCB Record - `type SVCBRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type SVCBRecordType` Record type. - `const SVCBRecordTypeSVCB SVCBRecordType = "SVCB"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted SVCB content. See 'data' to set SVCB properties. - `Data SVCBRecordData` Components of a SVCB record. - `Priority float64` Priority. - `Target string` Target. - `Value string` Value. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings SVCBRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### TLSA Record - `type TLSARecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type TLSARecordType` Record type. - `const TLSARecordTypeTLSA TLSARecordType = "TLSA"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted TLSA content. See 'data' to set TLSA properties. - `Data TLSARecordData` Components of a TLSA record. - `Certificate string` Certificate. - `MatchingType float64` Matching Type. - `Selector float64` Selector. - `Usage float64` Usage. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings TLSARecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### TTL - `type TTL interface{…}` 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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` ### TXT Record - `type TXTRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type TXTRecordType` Record type. - `const TXTRecordTypeTXT TXTRecordType = "TXT"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Text content for the record. The content must consist of quoted "character strings" (RFC 1035), each with a length of up to 255 bytes. Strings exceeding this allowed maximum length are automatically split. Learn more at . - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings TXTRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. ### URI Record - `type URIRecord struct{…}` - `Name string` Complete DNS record name, including the zone name, in Punycode. - `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. - `float64` - `type TTL float64` 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. - `const TTL1 TTL = 1` - `Type URIRecordType` Record type. - `const URIRecordTypeURI URIRecordType = "URI"` - `Comment string` Comments or notes about the DNS record. This field has no effect on DNS responses. - `Content string` Formatted URI content. See 'data' to set URI properties. - `Data URIRecordData` Components of a URI record. - `Target string` The record content. - `Weight float64` The record weight. - `Priority float64` Required for MX and URI records; ignored for other record types (but may still be returned by the API). Records with lower priorities are preferred. This field is to be deprecated in favor of the priority field within the data map. - `Proxied bool` Whether the record is receiving the performance and security benefits of Cloudflare. - `Settings URIRecordSettings` Settings for the DNS record. - `IPV4Only bool` 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. - `IPV6Only bool` 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 []RecordTags` Custom tags for the DNS record. This field has no effect on DNS responses. # Usage # Zone # Account # Settings # Zone ## Show DNS Settings `client.DNS.Settings.Zone.Get(ctx, query) (*SettingZoneGetResponse, error)` **get** `/zones/{zone_id}/dns_settings` Show DNS settings for a zone ### Parameters - `query SettingZoneGetParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type SettingZoneGetResponse struct{…}` - `FlattenAllCNAMEs bool` Whether to flatten all CNAME records in the zone. Note that, due to DNS limitations, a CNAME record at the zone apex will always be flattened. - `FoundationDNS bool` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `InternalDNS SettingZoneGetResponseInternalDNS` Settings for this internal zone. - `ReferenceZoneID string` The ID of the zone to fallback to. - `MultiProvider bool` Whether to enable multi-provider DNS, which causes Cloudflare to activate the zone even when non-Cloudflare NS records exist, and to respect NS records at the zone apex during outbound zone transfers. - `Nameservers SettingZoneGetResponseNameservers` Settings determining the nameservers through which the zone should be available. - `Type SettingZoneGetResponseNameserversType` Nameserver type - `const SettingZoneGetResponseNameserversTypeCloudflareStandard SettingZoneGetResponseNameserversType = "cloudflare.standard"` - `const SettingZoneGetResponseNameserversTypeCustomAccount SettingZoneGetResponseNameserversType = "custom.account"` - `const SettingZoneGetResponseNameserversTypeCustomTenant SettingZoneGetResponseNameserversType = "custom.tenant"` - `const SettingZoneGetResponseNameserversTypeCustomZone SettingZoneGetResponseNameserversType = "custom.zone"` - `NSSet int64` Configured nameserver set to be used for this zone - `NSTTL float64` The time to live (TTL) of the zone's nameserver (NS) records. - `SecondaryOverrides bool` Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex. - `SOA SettingZoneGetResponseSOA` Components of the zone's SOA record. - `Expire float64` Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone. - `MinTTL float64` The time to live (TTL) for negative caching of records within the zone. - `MNAME string` The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used. - `Refresh float64` Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated. - `Retry float64` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `RNAME string` The email address of the zone administrator, with the first label representing the local part of the email address. - `TTL float64` The time to live (TTL) of the SOA record itself. - `ZoneMode SettingZoneGetResponseZoneMode` Whether the zone mode is a regular or CDN/DNS only zone. - `const SettingZoneGetResponseZoneModeStandard SettingZoneGetResponseZoneMode = "standard"` - `const SettingZoneGetResponseZoneModeCDNOnly SettingZoneGetResponseZoneMode = "cdn_only"` - `const SettingZoneGetResponseZoneModeDNSOnly SettingZoneGetResponseZoneMode = "dns_only"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) zone, err := client.DNS.Settings.Zone.Get(context.TODO(), dns.SettingZoneGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", zone.MultiProvider) } ``` #### 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": { "flatten_all_cnames": false, "foundation_dns": false, "internal_dns": { "reference_zone_id": "reference_zone_id" }, "multi_provider": false, "nameservers": { "type": "cloudflare.standard", "ns_set": 1 }, "ns_ttl": 86400, "secondary_overrides": false, "soa": { "expire": 604800, "min_ttl": 1800, "mname": "kristina.ns.cloudflare.com", "refresh": 10000, "retry": 2400, "rname": "admin.example.com", "ttl": 3600 }, "zone_mode": "dns_only" } } ``` ## Update DNS Settings `client.DNS.Settings.Zone.Edit(ctx, params) (*SettingZoneEditResponse, error)` **patch** `/zones/{zone_id}/dns_settings` Update DNS settings for a zone ### Parameters - `params SettingZoneEditParams` - `ZoneID param.Field[string]` Path param: Identifier. - `FlattenAllCNAMEs param.Field[bool]` Body param: Whether to flatten all CNAME records in the zone. Note that, due to DNS limitations, a CNAME record at the zone apex will always be flattened. - `FoundationDNS param.Field[bool]` Body param: Whether to enable Foundation DNS Advanced Nameservers on the zone. - `InternalDNS param.Field[SettingZoneEditParamsInternalDNS]` Body param: Settings for this internal zone. - `ReferenceZoneID string` The ID of the zone to fallback to. - `MultiProvider param.Field[bool]` Body param: Whether to enable multi-provider DNS, which causes Cloudflare to activate the zone even when non-Cloudflare NS records exist, and to respect NS records at the zone apex during outbound zone transfers. - `Nameservers param.Field[SettingZoneEditParamsNameservers]` Body param: Settings determining the nameservers through which the zone should be available. - `NSSet int64` Configured nameserver set to be used for this zone - `Type SettingZoneEditParamsNameserversType` Nameserver type - `const SettingZoneEditParamsNameserversTypeCloudflareStandard SettingZoneEditParamsNameserversType = "cloudflare.standard"` - `const SettingZoneEditParamsNameserversTypeCustomAccount SettingZoneEditParamsNameserversType = "custom.account"` - `const SettingZoneEditParamsNameserversTypeCustomTenant SettingZoneEditParamsNameserversType = "custom.tenant"` - `const SettingZoneEditParamsNameserversTypeCustomZone SettingZoneEditParamsNameserversType = "custom.zone"` - `NSTTL param.Field[float64]` Body param: The time to live (TTL) of the zone's nameserver (NS) records. - `SecondaryOverrides param.Field[bool]` Body param: Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex. - `SOA param.Field[SettingZoneEditParamsSOA]` Body param: Components of the zone's SOA record. - `Expire float64` Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone. - `MinTTL float64` The time to live (TTL) for negative caching of records within the zone. - `MNAME string` The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used. - `Refresh float64` Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated. - `Retry float64` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `RNAME string` The email address of the zone administrator, with the first label representing the local part of the email address. - `TTL float64` The time to live (TTL) of the SOA record itself. - `ZoneMode param.Field[SettingZoneEditParamsZoneMode]` Body param: Whether the zone mode is a regular or CDN/DNS only zone. - `const SettingZoneEditParamsZoneModeStandard SettingZoneEditParamsZoneMode = "standard"` - `const SettingZoneEditParamsZoneModeCDNOnly SettingZoneEditParamsZoneMode = "cdn_only"` - `const SettingZoneEditParamsZoneModeDNSOnly SettingZoneEditParamsZoneMode = "dns_only"` ### Returns - `type SettingZoneEditResponse struct{…}` - `FlattenAllCNAMEs bool` Whether to flatten all CNAME records in the zone. Note that, due to DNS limitations, a CNAME record at the zone apex will always be flattened. - `FoundationDNS bool` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `InternalDNS SettingZoneEditResponseInternalDNS` Settings for this internal zone. - `ReferenceZoneID string` The ID of the zone to fallback to. - `MultiProvider bool` Whether to enable multi-provider DNS, which causes Cloudflare to activate the zone even when non-Cloudflare NS records exist, and to respect NS records at the zone apex during outbound zone transfers. - `Nameservers SettingZoneEditResponseNameservers` Settings determining the nameservers through which the zone should be available. - `Type SettingZoneEditResponseNameserversType` Nameserver type - `const SettingZoneEditResponseNameserversTypeCloudflareStandard SettingZoneEditResponseNameserversType = "cloudflare.standard"` - `const SettingZoneEditResponseNameserversTypeCustomAccount SettingZoneEditResponseNameserversType = "custom.account"` - `const SettingZoneEditResponseNameserversTypeCustomTenant SettingZoneEditResponseNameserversType = "custom.tenant"` - `const SettingZoneEditResponseNameserversTypeCustomZone SettingZoneEditResponseNameserversType = "custom.zone"` - `NSSet int64` Configured nameserver set to be used for this zone - `NSTTL float64` The time to live (TTL) of the zone's nameserver (NS) records. - `SecondaryOverrides bool` Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex. - `SOA SettingZoneEditResponseSOA` Components of the zone's SOA record. - `Expire float64` Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone. - `MinTTL float64` The time to live (TTL) for negative caching of records within the zone. - `MNAME string` The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used. - `Refresh float64` Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated. - `Retry float64` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `RNAME string` The email address of the zone administrator, with the first label representing the local part of the email address. - `TTL float64` The time to live (TTL) of the SOA record itself. - `ZoneMode SettingZoneEditResponseZoneMode` Whether the zone mode is a regular or CDN/DNS only zone. - `const SettingZoneEditResponseZoneModeStandard SettingZoneEditResponseZoneMode = "standard"` - `const SettingZoneEditResponseZoneModeCDNOnly SettingZoneEditResponseZoneMode = "cdn_only"` - `const SettingZoneEditResponseZoneModeDNSOnly SettingZoneEditResponseZoneMode = "dns_only"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DNS.Settings.Zone.Edit(context.TODO(), dns.SettingZoneEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.MultiProvider) } ``` #### 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": { "flatten_all_cnames": false, "foundation_dns": false, "internal_dns": { "reference_zone_id": "reference_zone_id" }, "multi_provider": false, "nameservers": { "type": "cloudflare.standard", "ns_set": 1 }, "ns_ttl": 86400, "secondary_overrides": false, "soa": { "expire": 604800, "min_ttl": 1800, "mname": "kristina.ns.cloudflare.com", "refresh": 10000, "retry": 2400, "rname": "admin.example.com", "ttl": 3600 }, "zone_mode": "dns_only" } } ``` # Account ## Show DNS Settings `client.DNS.Settings.Account.Get(ctx, query) (*SettingAccountGetResponse, error)` **get** `/accounts/{account_id}/dns_settings` Show DNS settings for an account ### Parameters - `query SettingAccountGetParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type SettingAccountGetResponse struct{…}` - `ZoneDefaults SettingAccountGetResponseZoneDefaults` - `FlattenAllCNAMEs bool` Whether to flatten all CNAME records in the zone. Note that, due to DNS limitations, a CNAME record at the zone apex will always be flattened. - `FoundationDNS bool` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `InternalDNS SettingAccountGetResponseZoneDefaultsInternalDNS` Settings for this internal zone. - `ReferenceZoneID string` The ID of the zone to fallback to. - `MultiProvider bool` Whether to enable multi-provider DNS, which causes Cloudflare to activate the zone even when non-Cloudflare NS records exist, and to respect NS records at the zone apex during outbound zone transfers. - `Nameservers SettingAccountGetResponseZoneDefaultsNameservers` Settings determining the nameservers through which the zone should be available. - `Type SettingAccountGetResponseZoneDefaultsNameserversType` Nameserver type - `const SettingAccountGetResponseZoneDefaultsNameserversTypeCloudflareStandard SettingAccountGetResponseZoneDefaultsNameserversType = "cloudflare.standard"` - `const SettingAccountGetResponseZoneDefaultsNameserversTypeCloudflareStandardRandom SettingAccountGetResponseZoneDefaultsNameserversType = "cloudflare.standard.random"` - `const SettingAccountGetResponseZoneDefaultsNameserversTypeCustomAccount SettingAccountGetResponseZoneDefaultsNameserversType = "custom.account"` - `const SettingAccountGetResponseZoneDefaultsNameserversTypeCustomTenant SettingAccountGetResponseZoneDefaultsNameserversType = "custom.tenant"` - `NSTTL float64` The time to live (TTL) of the zone's nameserver (NS) records. - `SecondaryOverrides bool` Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex. - `SOA SettingAccountGetResponseZoneDefaultsSOA` Components of the zone's SOA record. - `Expire float64` Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone. - `MinTTL float64` The time to live (TTL) for negative caching of records within the zone. - `MNAME string` The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used. - `Refresh float64` Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated. - `Retry float64` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `RNAME string` The email address of the zone administrator, with the first label representing the local part of the email address. - `TTL float64` The time to live (TTL) of the SOA record itself. - `ZoneMode SettingAccountGetResponseZoneDefaultsZoneMode` Whether the zone mode is a regular or CDN/DNS only zone. - `const SettingAccountGetResponseZoneDefaultsZoneModeStandard SettingAccountGetResponseZoneDefaultsZoneMode = "standard"` - `const SettingAccountGetResponseZoneDefaultsZoneModeCDNOnly SettingAccountGetResponseZoneDefaultsZoneMode = "cdn_only"` - `const SettingAccountGetResponseZoneDefaultsZoneModeDNSOnly SettingAccountGetResponseZoneDefaultsZoneMode = "dns_only"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) account, err := client.DNS.Settings.Account.Get(context.TODO(), dns.SettingAccountGetParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", account.ZoneDefaults) } ``` #### 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": { "zone_defaults": { "flatten_all_cnames": false, "foundation_dns": false, "internal_dns": { "reference_zone_id": "reference_zone_id" }, "multi_provider": false, "nameservers": { "type": "cloudflare.standard" }, "ns_ttl": 86400, "secondary_overrides": false, "soa": { "expire": 604800, "min_ttl": 1800, "mname": "kristina.ns.cloudflare.com", "refresh": 10000, "retry": 2400, "rname": "admin.example.com", "ttl": 3600 }, "zone_mode": "dns_only" } } } ``` ## Update DNS Settings `client.DNS.Settings.Account.Edit(ctx, params) (*SettingAccountEditResponse, error)` **patch** `/accounts/{account_id}/dns_settings` Update DNS settings for an account ### Parameters - `params SettingAccountEditParams` - `AccountID param.Field[string]` Path param: Identifier. - `ZoneDefaults param.Field[SettingAccountEditParamsZoneDefaults]` Body param - `FlattenAllCNAMEs bool` Whether to flatten all CNAME records in the zone. Note that, due to DNS limitations, a CNAME record at the zone apex will always be flattened. - `FoundationDNS bool` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `InternalDNS SettingAccountEditParamsZoneDefaultsInternalDNS` Settings for this internal zone. - `ReferenceZoneID string` The ID of the zone to fallback to. - `MultiProvider bool` Whether to enable multi-provider DNS, which causes Cloudflare to activate the zone even when non-Cloudflare NS records exist, and to respect NS records at the zone apex during outbound zone transfers. - `Nameservers SettingAccountEditParamsZoneDefaultsNameservers` Settings determining the nameservers through which the zone should be available. - `Type SettingAccountEditParamsZoneDefaultsNameserversType` Nameserver type - `const SettingAccountEditParamsZoneDefaultsNameserversTypeCloudflareStandard SettingAccountEditParamsZoneDefaultsNameserversType = "cloudflare.standard"` - `const SettingAccountEditParamsZoneDefaultsNameserversTypeCloudflareStandardRandom SettingAccountEditParamsZoneDefaultsNameserversType = "cloudflare.standard.random"` - `const SettingAccountEditParamsZoneDefaultsNameserversTypeCustomAccount SettingAccountEditParamsZoneDefaultsNameserversType = "custom.account"` - `const SettingAccountEditParamsZoneDefaultsNameserversTypeCustomTenant SettingAccountEditParamsZoneDefaultsNameserversType = "custom.tenant"` - `NSTTL float64` The time to live (TTL) of the zone's nameserver (NS) records. - `SecondaryOverrides bool` Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex. - `SOA SettingAccountEditParamsZoneDefaultsSOA` Components of the zone's SOA record. - `Expire float64` Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone. - `MinTTL float64` The time to live (TTL) for negative caching of records within the zone. - `MNAME string` The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used. - `Refresh float64` Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated. - `Retry float64` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `RNAME string` The email address of the zone administrator, with the first label representing the local part of the email address. - `TTL float64` The time to live (TTL) of the SOA record itself. - `ZoneMode SettingAccountEditParamsZoneDefaultsZoneMode` Whether the zone mode is a regular or CDN/DNS only zone. - `const SettingAccountEditParamsZoneDefaultsZoneModeStandard SettingAccountEditParamsZoneDefaultsZoneMode = "standard"` - `const SettingAccountEditParamsZoneDefaultsZoneModeCDNOnly SettingAccountEditParamsZoneDefaultsZoneMode = "cdn_only"` - `const SettingAccountEditParamsZoneDefaultsZoneModeDNSOnly SettingAccountEditParamsZoneDefaultsZoneMode = "dns_only"` ### Returns - `type SettingAccountEditResponse struct{…}` - `ZoneDefaults SettingAccountEditResponseZoneDefaults` - `FlattenAllCNAMEs bool` Whether to flatten all CNAME records in the zone. Note that, due to DNS limitations, a CNAME record at the zone apex will always be flattened. - `FoundationDNS bool` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `InternalDNS SettingAccountEditResponseZoneDefaultsInternalDNS` Settings for this internal zone. - `ReferenceZoneID string` The ID of the zone to fallback to. - `MultiProvider bool` Whether to enable multi-provider DNS, which causes Cloudflare to activate the zone even when non-Cloudflare NS records exist, and to respect NS records at the zone apex during outbound zone transfers. - `Nameservers SettingAccountEditResponseZoneDefaultsNameservers` Settings determining the nameservers through which the zone should be available. - `Type SettingAccountEditResponseZoneDefaultsNameserversType` Nameserver type - `const SettingAccountEditResponseZoneDefaultsNameserversTypeCloudflareStandard SettingAccountEditResponseZoneDefaultsNameserversType = "cloudflare.standard"` - `const SettingAccountEditResponseZoneDefaultsNameserversTypeCloudflareStandardRandom SettingAccountEditResponseZoneDefaultsNameserversType = "cloudflare.standard.random"` - `const SettingAccountEditResponseZoneDefaultsNameserversTypeCustomAccount SettingAccountEditResponseZoneDefaultsNameserversType = "custom.account"` - `const SettingAccountEditResponseZoneDefaultsNameserversTypeCustomTenant SettingAccountEditResponseZoneDefaultsNameserversType = "custom.tenant"` - `NSTTL float64` The time to live (TTL) of the zone's nameserver (NS) records. - `SecondaryOverrides bool` Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex. - `SOA SettingAccountEditResponseZoneDefaultsSOA` Components of the zone's SOA record. - `Expire float64` Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone. - `MinTTL float64` The time to live (TTL) for negative caching of records within the zone. - `MNAME string` The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used. - `Refresh float64` Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated. - `Retry float64` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `RNAME string` The email address of the zone administrator, with the first label representing the local part of the email address. - `TTL float64` The time to live (TTL) of the SOA record itself. - `ZoneMode SettingAccountEditResponseZoneDefaultsZoneMode` Whether the zone mode is a regular or CDN/DNS only zone. - `const SettingAccountEditResponseZoneDefaultsZoneModeStandard SettingAccountEditResponseZoneDefaultsZoneMode = "standard"` - `const SettingAccountEditResponseZoneDefaultsZoneModeCDNOnly SettingAccountEditResponseZoneDefaultsZoneMode = "cdn_only"` - `const SettingAccountEditResponseZoneDefaultsZoneModeDNSOnly SettingAccountEditResponseZoneDefaultsZoneMode = "dns_only"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DNS.Settings.Account.Edit(context.TODO(), dns.SettingAccountEditParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.ZoneDefaults) } ``` #### 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": { "zone_defaults": { "flatten_all_cnames": false, "foundation_dns": false, "internal_dns": { "reference_zone_id": "reference_zone_id" }, "multi_provider": false, "nameservers": { "type": "cloudflare.standard" }, "ns_ttl": 86400, "secondary_overrides": false, "soa": { "expire": 604800, "min_ttl": 1800, "mname": "kristina.ns.cloudflare.com", "refresh": 10000, "retry": 2400, "rname": "admin.example.com", "ttl": 3600 }, "zone_mode": "dns_only" } } } ``` # Views ## List Internal DNS Views `client.DNS.Settings.Account.Views.List(ctx, params) (*V4PagePaginationArray[SettingAccountViewListResponse], error)` **get** `/accounts/{account_id}/dns_settings/views` List DNS Internal Views for an Account ### Parameters - `params SettingAccountViewListParams` - `AccountID param.Field[string]` Path param: Identifier. - `Direction param.Field[SettingAccountViewListParamsDirection]` Query param: Direction to order DNS views in. - `const SettingAccountViewListParamsDirectionAsc SettingAccountViewListParamsDirection = "asc"` - `const SettingAccountViewListParamsDirectionDesc SettingAccountViewListParamsDirection = "desc"` - `Match param.Field[SettingAccountViewListParamsMatch]` 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. - `const SettingAccountViewListParamsMatchAny SettingAccountViewListParamsMatch = "any"` - `const SettingAccountViewListParamsMatchAll SettingAccountViewListParamsMatch = "all"` - `Name param.Field[SettingAccountViewListParamsName]` Query param - `Contains string` Substring of the DNS view name. - `Endswith string` Suffix of the DNS view name. - `Exact string` Exact value of the DNS view name. - `Startswith string` Prefix of the DNS view name. - `Order param.Field[SettingAccountViewListParamsOrder]` Query param: Field to order DNS views by. - `const SettingAccountViewListParamsOrderName SettingAccountViewListParamsOrder = "name"` - `const SettingAccountViewListParamsOrderCreatedOn SettingAccountViewListParamsOrder = "created_on"` - `const SettingAccountViewListParamsOrderModifiedOn SettingAccountViewListParamsOrder = "modified_on"` - `Page param.Field[float64]` Query param: Page number of paginated results. - `PerPage param.Field[float64]` Query param: Number of DNS views per page. - `ZoneID param.Field[string]` Query param: A zone ID that exists in the zones list for the view. - `ZoneName param.Field[string]` Query param: A zone name that exists in the zones list for the view. ### Returns - `type SettingAccountViewListResponse struct{…}` - `ID string` Identifier. - `CreatedTime Time` When the view was created. - `ModifiedTime Time` When the view was last modified. - `Name string` The name of the view. - `Zones []string` The list of zones linked to this view. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.DNS.Settings.Account.Views.List(context.TODO(), dns.SettingAccountViewListParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### 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": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "created_time": "2014-01-01T05:20:00.12345Z", "modified_time": "2014-01-01T05:20:00.12345Z", "name": "my view", "zones": [ "372e67954025e0ba6aaa6d586b9e0b59" ] } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## DNS Internal View Details `client.DNS.Settings.Account.Views.Get(ctx, viewID, query) (*SettingAccountViewGetResponse, error)` **get** `/accounts/{account_id}/dns_settings/views/{view_id}` Get DNS Internal View ### Parameters - `viewID string` Identifier. - `query SettingAccountViewGetParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type SettingAccountViewGetResponse struct{…}` - `ID string` Identifier. - `CreatedTime Time` When the view was created. - `ModifiedTime Time` When the view was last modified. - `Name string` The name of the view. - `Zones []string` The list of zones linked to this view. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) view, err := client.DNS.Settings.Account.Views.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", dns.SettingAccountViewGetParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", view.ID) } ``` #### 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": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "created_time": "2014-01-01T05:20:00.12345Z", "modified_time": "2014-01-01T05:20:00.12345Z", "name": "my view", "zones": [ "372e67954025e0ba6aaa6d586b9e0b59" ] } } ``` ## Create Internal DNS View `client.DNS.Settings.Account.Views.New(ctx, params) (*SettingAccountViewNewResponse, error)` **post** `/accounts/{account_id}/dns_settings/views` Create Internal DNS View for an account ### Parameters - `params SettingAccountViewNewParams` - `AccountID param.Field[string]` Path param: Identifier. - `Name param.Field[string]` Body param: The name of the view. - `Zones param.Field[[]string]` Body param: The list of zones linked to this view. ### Returns - `type SettingAccountViewNewResponse struct{…}` - `ID string` Identifier. - `CreatedTime Time` When the view was created. - `ModifiedTime Time` When the view was last modified. - `Name string` The name of the view. - `Zones []string` The list of zones linked to this view. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) view, err := client.DNS.Settings.Account.Views.New(context.TODO(), dns.SettingAccountViewNewParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Name: cloudflare.F("my view"), Zones: cloudflare.F([]string{"372e67954025e0ba6aaa6d586b9e0b59"}), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", view.ID) } ``` #### 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": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "created_time": "2014-01-01T05:20:00.12345Z", "modified_time": "2014-01-01T05:20:00.12345Z", "name": "my view", "zones": [ "372e67954025e0ba6aaa6d586b9e0b59" ] } } ``` ## Update Internal DNS View `client.DNS.Settings.Account.Views.Edit(ctx, viewID, params) (*SettingAccountViewEditResponse, error)` **patch** `/accounts/{account_id}/dns_settings/views/{view_id}` Update an existing Internal DNS View ### Parameters - `viewID string` Identifier. - `params SettingAccountViewEditParams` - `AccountID param.Field[string]` Path param: Identifier. - `Name param.Field[string]` Body param: The name of the view. - `Zones param.Field[[]string]` Body param: The list of zones linked to this view. ### Returns - `type SettingAccountViewEditResponse struct{…}` - `ID string` Identifier. - `CreatedTime Time` When the view was created. - `ModifiedTime Time` When the view was last modified. - `Name string` The name of the view. - `Zones []string` The list of zones linked to this view. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DNS.Settings.Account.Views.Edit( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", dns.SettingAccountViewEditParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.ID) } ``` #### 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": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "created_time": "2014-01-01T05:20:00.12345Z", "modified_time": "2014-01-01T05:20:00.12345Z", "name": "my view", "zones": [ "372e67954025e0ba6aaa6d586b9e0b59" ] } } ``` ## Delete Internal DNS View `client.DNS.Settings.Account.Views.Delete(ctx, viewID, body) (*SettingAccountViewDeleteResponse, error)` **delete** `/accounts/{account_id}/dns_settings/views/{view_id}` Delete an existing Internal DNS View ### Parameters - `viewID string` Identifier. - `body SettingAccountViewDeleteParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type SettingAccountViewDeleteResponse struct{…}` - `ID string` Identifier. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) view, err := client.DNS.Settings.Account.Views.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", dns.SettingAccountViewDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", view.ID) } ``` #### Response ```json { "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353" } } ``` # Analytics # Reports ## Table `client.DNS.Analytics.Reports.Get(ctx, params) (*Report, error)` **get** `/zones/{zone_id}/dns_analytics/report` Retrieves a list of summarised aggregate metrics over a given time period. See [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/) for detailed information about the available query parameters. ### Parameters - `params AnalyticsReportGetParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Dimensions param.Field[string]` Query param: A comma-separated list of dimensions to group results by. - `Filters param.Field[string]` Query param: Segmentation filter in 'attribute operator value' format. - `Limit param.Field[int64]` Query param: Limit number of returned metrics. - `Metrics param.Field[string]` Query param: A comma-separated list of metrics to query. - `Since param.Field[Time]` Query param: Start date and time of requesting data period in ISO 8601 format. - `Sort param.Field[string]` Query param: A comma-separated list of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending). - `Until param.Field[Time]` Query param: End date and time of requesting data period in ISO 8601 format. ### Returns - `type Report struct{…}` - `Data []ReportData` Array with one row per combination of dimension values. - `Dimensions []string` Array of dimension values, representing the combination of dimension values corresponding to this row. - `Metrics []float64` Array with one item per requested metric. Each item is a single value. - `DataLag float64` Number of seconds between current time and last processed event, in another words how many seconds of data could be missing. - `Max unknown` Maximum results for each metric (object mapping metric names to values). Currently always an empty object. - `Min unknown` Minimum results for each metric (object mapping metric names to values). Currently always an empty object. - `Query ReportQuery` - `Dimensions []string` Array of dimension names. - `Limit int64` Limit number of returned metrics. - `Metrics []string` Array of metric names. - `Since Time` Start date and time of requesting data period in ISO 8601 format. - `Until Time` End date and time of requesting data period in ISO 8601 format. - `Filters string` Segmentation filter in 'attribute operator value' format. - `Sort []string` Array of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending). - `Rows float64` Total number of rows in the result. - `Totals unknown` Total results for metrics across all data (object mapping metric names to values). ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) report, err := client.DNS.Analytics.Reports.Get(context.TODO(), dns.AnalyticsReportGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", report.Data) } ``` #### 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": { "data": [ { "dimensions": [ "NODATA" ], "metrics": [ 0 ] } ], "data_lag": 60, "max": {}, "min": {}, "query": { "dimensions": [ "responseCode", "queryName" ], "limit": 100, "metrics": [ "queryCount", "responseTimeAvg" ], "since": "2023-11-11T12:00:00Z", "until": "2023-11-11T13:00:00Z", "filters": "responseCode==NOERROR,queryType==A", "sort": [ "+responseCode", "-queryName" ] }, "rows": 100, "totals": {} } } ``` ## Domain Types ### Report - `type Report struct{…}` - `Data []ReportData` Array with one row per combination of dimension values. - `Dimensions []string` Array of dimension values, representing the combination of dimension values corresponding to this row. - `Metrics []float64` Array with one item per requested metric. Each item is a single value. - `DataLag float64` Number of seconds between current time and last processed event, in another words how many seconds of data could be missing. - `Max unknown` Maximum results for each metric (object mapping metric names to values). Currently always an empty object. - `Min unknown` Minimum results for each metric (object mapping metric names to values). Currently always an empty object. - `Query ReportQuery` - `Dimensions []string` Array of dimension names. - `Limit int64` Limit number of returned metrics. - `Metrics []string` Array of metric names. - `Since Time` Start date and time of requesting data period in ISO 8601 format. - `Until Time` End date and time of requesting data period in ISO 8601 format. - `Filters string` Segmentation filter in 'attribute operator value' format. - `Sort []string` Array of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending). - `Rows float64` Total number of rows in the result. - `Totals unknown` Total results for metrics across all data (object mapping metric names to values). # Bytimes ## By Time `client.DNS.Analytics.Reports.Bytimes.Get(ctx, params) (*ByTime, error)` **get** `/zones/{zone_id}/dns_analytics/report/bytime` Retrieves a list of aggregate metrics grouped by time interval. See [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/) for detailed information about the available query parameters. ### Parameters - `params AnalyticsReportBytimeGetParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Dimensions param.Field[string]` Query param: A comma-separated list of dimensions to group results by. - `Filters param.Field[string]` Query param: Segmentation filter in 'attribute operator value' format. - `Limit param.Field[int64]` Query param: Limit number of returned metrics. - `Metrics param.Field[string]` Query param: A comma-separated list of metrics to query. - `Since param.Field[Time]` Query param: Start date and time of requesting data period in ISO 8601 format. - `Sort param.Field[string]` Query param: A comma-separated list of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending). - `TimeDelta param.Field[AnalyticsReportBytimeGetParamsTimeDelta]` Query param: Unit of time to group data by. - `const AnalyticsReportBytimeGetParamsTimeDeltaAll AnalyticsReportBytimeGetParamsTimeDelta = "all"` - `const AnalyticsReportBytimeGetParamsTimeDeltaAuto AnalyticsReportBytimeGetParamsTimeDelta = "auto"` - `const AnalyticsReportBytimeGetParamsTimeDeltaYear AnalyticsReportBytimeGetParamsTimeDelta = "year"` - `const AnalyticsReportBytimeGetParamsTimeDeltaQuarter AnalyticsReportBytimeGetParamsTimeDelta = "quarter"` - `const AnalyticsReportBytimeGetParamsTimeDeltaMonth AnalyticsReportBytimeGetParamsTimeDelta = "month"` - `const AnalyticsReportBytimeGetParamsTimeDeltaWeek AnalyticsReportBytimeGetParamsTimeDelta = "week"` - `const AnalyticsReportBytimeGetParamsTimeDeltaDay AnalyticsReportBytimeGetParamsTimeDelta = "day"` - `const AnalyticsReportBytimeGetParamsTimeDeltaHour AnalyticsReportBytimeGetParamsTimeDelta = "hour"` - `const AnalyticsReportBytimeGetParamsTimeDeltaDekaminute AnalyticsReportBytimeGetParamsTimeDelta = "dekaminute"` - `const AnalyticsReportBytimeGetParamsTimeDeltaMinute AnalyticsReportBytimeGetParamsTimeDelta = "minute"` - `Until param.Field[Time]` Query param: End date and time of requesting data period in ISO 8601 format. ### Returns - `type ByTime struct{…}` - `Data []ByTimeData` Array with one row per combination of dimension values. - `Dimensions []string` Array of dimension values, representing the combination of dimension values corresponding to this row. - `Metrics [][]float64` Array with one item per requested metric. Each item is an array of values, broken down by time interval. - `DataLag float64` Number of seconds between current time and last processed event, in another words how many seconds of data could be missing. - `Max unknown` Maximum results for each metric (object mapping metric names to values). Currently always an empty object. - `Min unknown` Minimum results for each metric (object mapping metric names to values). Currently always an empty object. - `Query ByTimeQuery` - `Dimensions []string` Array of dimension names. - `Limit int64` Limit number of returned metrics. - `Metrics []string` Array of metric names. - `Since Time` Start date and time of requesting data period in ISO 8601 format. - `TimeDelta ByTimeQueryTimeDelta` Unit of time to group data by. - `const ByTimeQueryTimeDeltaAll ByTimeQueryTimeDelta = "all"` - `const ByTimeQueryTimeDeltaAuto ByTimeQueryTimeDelta = "auto"` - `const ByTimeQueryTimeDeltaYear ByTimeQueryTimeDelta = "year"` - `const ByTimeQueryTimeDeltaQuarter ByTimeQueryTimeDelta = "quarter"` - `const ByTimeQueryTimeDeltaMonth ByTimeQueryTimeDelta = "month"` - `const ByTimeQueryTimeDeltaWeek ByTimeQueryTimeDelta = "week"` - `const ByTimeQueryTimeDeltaDay ByTimeQueryTimeDelta = "day"` - `const ByTimeQueryTimeDeltaHour ByTimeQueryTimeDelta = "hour"` - `const ByTimeQueryTimeDeltaDekaminute ByTimeQueryTimeDelta = "dekaminute"` - `const ByTimeQueryTimeDeltaMinute ByTimeQueryTimeDelta = "minute"` - `Until Time` End date and time of requesting data period in ISO 8601 format. - `Filters string` Segmentation filter in 'attribute operator value' format. - `Sort []string` Array of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending). - `Rows float64` Total number of rows in the result. - `TimeIntervals [][]Time` Array of time intervals in the response data. Each interval is represented as an array containing two values: the start time, and the end time. - `Totals unknown` Total results for metrics across all data (object mapping metric names to values). ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) byTime, err := client.DNS.Analytics.Reports.Bytimes.Get(context.TODO(), dns.AnalyticsReportBytimeGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", byTime.Data) } ``` #### 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": { "data": [ { "dimensions": [ "NODATA" ], "metrics": [ [ 0 ] ] } ], "data_lag": 60, "max": {}, "min": {}, "query": { "dimensions": [ "responseCode", "queryName" ], "limit": 100, "metrics": [ "queryCount", "responseTimeAvg" ], "since": "2023-11-11T12:00:00Z", "time_delta": "hour", "until": "2023-11-11T13:00:00Z", "filters": "responseCode==NOERROR,queryType==A", "sort": [ "+responseCode", "-queryName" ] }, "rows": 100, "time_intervals": [ [ "2023-11-11T12:00:00Z" ] ], "totals": {} } } ``` ## Domain Types ### By Time - `type ByTime struct{…}` - `Data []ByTimeData` Array with one row per combination of dimension values. - `Dimensions []string` Array of dimension values, representing the combination of dimension values corresponding to this row. - `Metrics [][]float64` Array with one item per requested metric. Each item is an array of values, broken down by time interval. - `DataLag float64` Number of seconds between current time and last processed event, in another words how many seconds of data could be missing. - `Max unknown` Maximum results for each metric (object mapping metric names to values). Currently always an empty object. - `Min unknown` Minimum results for each metric (object mapping metric names to values). Currently always an empty object. - `Query ByTimeQuery` - `Dimensions []string` Array of dimension names. - `Limit int64` Limit number of returned metrics. - `Metrics []string` Array of metric names. - `Since Time` Start date and time of requesting data period in ISO 8601 format. - `TimeDelta ByTimeQueryTimeDelta` Unit of time to group data by. - `const ByTimeQueryTimeDeltaAll ByTimeQueryTimeDelta = "all"` - `const ByTimeQueryTimeDeltaAuto ByTimeQueryTimeDelta = "auto"` - `const ByTimeQueryTimeDeltaYear ByTimeQueryTimeDelta = "year"` - `const ByTimeQueryTimeDeltaQuarter ByTimeQueryTimeDelta = "quarter"` - `const ByTimeQueryTimeDeltaMonth ByTimeQueryTimeDelta = "month"` - `const ByTimeQueryTimeDeltaWeek ByTimeQueryTimeDelta = "week"` - `const ByTimeQueryTimeDeltaDay ByTimeQueryTimeDelta = "day"` - `const ByTimeQueryTimeDeltaHour ByTimeQueryTimeDelta = "hour"` - `const ByTimeQueryTimeDeltaDekaminute ByTimeQueryTimeDelta = "dekaminute"` - `const ByTimeQueryTimeDeltaMinute ByTimeQueryTimeDelta = "minute"` - `Until Time` End date and time of requesting data period in ISO 8601 format. - `Filters string` Segmentation filter in 'attribute operator value' format. - `Sort []string` Array of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending). - `Rows float64` Total number of rows in the result. - `TimeIntervals [][]Time` Array of time intervals in the response data. Each interval is represented as an array containing two values: the start time, and the end time. - `Totals unknown` Total results for metrics across all data (object mapping metric names to values). # Zone Transfers # Force AXFR ## Force AXFR `client.DNS.ZoneTransfers.ForceAXFR.New(ctx, params) (*ForceAXFR, error)` **post** `/zones/{zone_id}/secondary_dns/force_axfr` Sends AXFR zone transfer request to primary nameserver(s). ### Parameters - `params ZoneTransferForceAXFRNewParams` - `ZoneID param.Field[string]` Path param - `Body param.Field[unknown]` Body param ### Returns - `type ForceAXFR string` When force_axfr query parameter is set to true, the response is a simple string. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) forceAXFR, err := client.DNS.ZoneTransfers.ForceAXFR.New(context.TODO(), dns.ZoneTransferForceAXFRNewParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), Body: map[string]interface{}{ }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", forceAXFR) } ``` #### 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": "OK" } ``` ## Domain Types ### Force AXFR - `type ForceAXFR string` When force_axfr query parameter is set to true, the response is a simple string. # Incoming ## Secondary Zone Configuration Details `client.DNS.ZoneTransfers.Incoming.Get(ctx, query) (*ZoneTransferIncomingGetResponse, error)` **get** `/zones/{zone_id}/secondary_dns/incoming` Get secondary zone configuration for incoming zone transfers. ### Parameters - `query ZoneTransferIncomingGetParams` - `ZoneID param.Field[string]` ### Returns - `type ZoneTransferIncomingGetResponse struct{…}` - `ID string` - `AutoRefreshSeconds float64` How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not applicable for primary zones. - `CheckedTime string` The time for a specific event. - `CreatedTime string` The time for a specific event. - `ModifiedTime string` The time for a specific event. - `Name string` Zone name. - `Peers []string` A list of peer tags. - `SOASerial float64` The serial number of the SOA for the given zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) incoming, err := client.DNS.ZoneTransfers.Incoming.Get(context.TODO(), dns.ZoneTransferIncomingGetParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", incoming.ID) } ``` #### 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": { "id": "269d8f4853475ca241c4e730be286b20", "auto_refresh_seconds": 86400, "checked_time": "2019-10-24T17:09:42.883908+01:00", "created_time": "2019-10-24T17:09:42.883908+01:00", "modified_time": "2019-10-24T17:09:42.883908+01:00", "name": "www.example.com.", "peers": [ "23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194" ], "soa_serial": 2019102400 } } ``` ## Create Secondary Zone Configuration `client.DNS.ZoneTransfers.Incoming.New(ctx, params) (*ZoneTransferIncomingNewResponse, error)` **post** `/zones/{zone_id}/secondary_dns/incoming` Create secondary zone configuration for incoming zone transfers. ### Parameters - `params ZoneTransferIncomingNewParams` - `ZoneID param.Field[string]` Path param - `AutoRefreshSeconds param.Field[float64]` Body param: How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not applicable for primary zones. - `Name param.Field[string]` Body param: Zone name. - `Peers param.Field[[]string]` Body param: A list of peer tags. ### Returns - `type ZoneTransferIncomingNewResponse struct{…}` - `ID string` - `AutoRefreshSeconds float64` How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not applicable for primary zones. - `CheckedTime string` The time for a specific event. - `CreatedTime string` The time for a specific event. - `ModifiedTime string` The time for a specific event. - `Name string` Zone name. - `Peers []string` A list of peer tags. - `SOASerial float64` The serial number of the SOA for the given zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) incoming, err := client.DNS.ZoneTransfers.Incoming.New(context.TODO(), dns.ZoneTransferIncomingNewParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), AutoRefreshSeconds: cloudflare.F(86400.000000), Name: cloudflare.F("www.example.com."), Peers: cloudflare.F([]string{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", incoming.ID) } ``` #### 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": { "id": "269d8f4853475ca241c4e730be286b20", "auto_refresh_seconds": 86400, "checked_time": "2019-10-24T17:09:42.883908+01:00", "created_time": "2019-10-24T17:09:42.883908+01:00", "modified_time": "2019-10-24T17:09:42.883908+01:00", "name": "www.example.com.", "peers": [ "23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194" ], "soa_serial": 2019102400 } } ``` ## Update Secondary Zone Configuration `client.DNS.ZoneTransfers.Incoming.Update(ctx, params) (*ZoneTransferIncomingUpdateResponse, error)` **put** `/zones/{zone_id}/secondary_dns/incoming` Update secondary zone configuration for incoming zone transfers. ### Parameters - `params ZoneTransferIncomingUpdateParams` - `ZoneID param.Field[string]` Path param - `AutoRefreshSeconds param.Field[float64]` Body param: How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not applicable for primary zones. - `Name param.Field[string]` Body param: Zone name. - `Peers param.Field[[]string]` Body param: A list of peer tags. ### Returns - `type ZoneTransferIncomingUpdateResponse struct{…}` - `ID string` - `AutoRefreshSeconds float64` How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not applicable for primary zones. - `CheckedTime string` The time for a specific event. - `CreatedTime string` The time for a specific event. - `ModifiedTime string` The time for a specific event. - `Name string` Zone name. - `Peers []string` A list of peer tags. - `SOASerial float64` The serial number of the SOA for the given zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) incoming, err := client.DNS.ZoneTransfers.Incoming.Update(context.TODO(), dns.ZoneTransferIncomingUpdateParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), AutoRefreshSeconds: cloudflare.F(86400.000000), Name: cloudflare.F("www.example.com."), Peers: cloudflare.F([]string{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", incoming.ID) } ``` #### 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": { "id": "269d8f4853475ca241c4e730be286b20", "auto_refresh_seconds": 86400, "checked_time": "2019-10-24T17:09:42.883908+01:00", "created_time": "2019-10-24T17:09:42.883908+01:00", "modified_time": "2019-10-24T17:09:42.883908+01:00", "name": "www.example.com.", "peers": [ "23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194" ], "soa_serial": 2019102400 } } ``` ## Delete Secondary Zone Configuration `client.DNS.ZoneTransfers.Incoming.Delete(ctx, body) (*ZoneTransferIncomingDeleteResponse, error)` **delete** `/zones/{zone_id}/secondary_dns/incoming` Delete secondary zone configuration for incoming zone transfers. ### Parameters - `body ZoneTransferIncomingDeleteParams` - `ZoneID param.Field[string]` ### Returns - `type ZoneTransferIncomingDeleteResponse struct{…}` - `ID string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) incoming, err := client.DNS.ZoneTransfers.Incoming.Delete(context.TODO(), dns.ZoneTransferIncomingDeleteParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", incoming.ID) } ``` #### 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": { "id": "269d8f4853475ca241c4e730be286b20" } } ``` ## Domain Types ### Incoming - `type Incoming struct{…}` - `ID string` - `AutoRefreshSeconds float64` How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not applicable for primary zones. - `CheckedTime string` The time for a specific event. - `CreatedTime string` The time for a specific event. - `ModifiedTime string` The time for a specific event. - `Name string` Zone name. - `Peers []string` A list of peer tags. - `SOASerial float64` The serial number of the SOA for the given zone. # Outgoing ## Primary Zone Configuration Details `client.DNS.ZoneTransfers.Outgoing.Get(ctx, query) (*ZoneTransferOutgoingGetResponse, error)` **get** `/zones/{zone_id}/secondary_dns/outgoing` Get primary zone configuration for outgoing zone transfers. ### Parameters - `query ZoneTransferOutgoingGetParams` - `ZoneID param.Field[string]` ### Returns - `type ZoneTransferOutgoingGetResponse struct{…}` - `ID string` - `CheckedTime string` The time for a specific event. - `CreatedTime string` The time for a specific event. - `LastTransferredTime string` The time for a specific event. - `Name string` Zone name. - `Peers []string` A list of peer tags. - `SOASerial float64` The serial number of the SOA for the given zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) outgoing, err := client.DNS.ZoneTransfers.Outgoing.Get(context.TODO(), dns.ZoneTransferOutgoingGetParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", outgoing.ID) } ``` #### 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": { "id": "269d8f4853475ca241c4e730be286b20", "checked_time": "2019-10-24T17:09:42.883908+01:00", "created_time": "2019-10-24T17:09:42.883908+01:00", "last_transferred_time": "2019-10-24T17:09:42.883908+01:00", "name": "www.example.com.", "peers": [ "23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194" ], "soa_serial": 2019102400 } } ``` ## Create Primary Zone Configuration `client.DNS.ZoneTransfers.Outgoing.New(ctx, params) (*ZoneTransferOutgoingNewResponse, error)` **post** `/zones/{zone_id}/secondary_dns/outgoing` Create primary zone configuration for outgoing zone transfers. ### Parameters - `params ZoneTransferOutgoingNewParams` - `ZoneID param.Field[string]` Path param - `Name param.Field[string]` Body param: Zone name. - `Peers param.Field[[]string]` Body param: A list of peer tags. ### Returns - `type ZoneTransferOutgoingNewResponse struct{…}` - `ID string` - `CheckedTime string` The time for a specific event. - `CreatedTime string` The time for a specific event. - `LastTransferredTime string` The time for a specific event. - `Name string` Zone name. - `Peers []string` A list of peer tags. - `SOASerial float64` The serial number of the SOA for the given zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) outgoing, err := client.DNS.ZoneTransfers.Outgoing.New(context.TODO(), dns.ZoneTransferOutgoingNewParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), Name: cloudflare.F("www.example.com."), Peers: cloudflare.F([]string{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", outgoing.ID) } ``` #### 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": { "id": "269d8f4853475ca241c4e730be286b20", "checked_time": "2019-10-24T17:09:42.883908+01:00", "created_time": "2019-10-24T17:09:42.883908+01:00", "last_transferred_time": "2019-10-24T17:09:42.883908+01:00", "name": "www.example.com.", "peers": [ "23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194" ], "soa_serial": 2019102400 } } ``` ## Update Primary Zone Configuration `client.DNS.ZoneTransfers.Outgoing.Update(ctx, params) (*ZoneTransferOutgoingUpdateResponse, error)` **put** `/zones/{zone_id}/secondary_dns/outgoing` Update primary zone configuration for outgoing zone transfers. ### Parameters - `params ZoneTransferOutgoingUpdateParams` - `ZoneID param.Field[string]` Path param - `Name param.Field[string]` Body param: Zone name. - `Peers param.Field[[]string]` Body param: A list of peer tags. ### Returns - `type ZoneTransferOutgoingUpdateResponse struct{…}` - `ID string` - `CheckedTime string` The time for a specific event. - `CreatedTime string` The time for a specific event. - `LastTransferredTime string` The time for a specific event. - `Name string` Zone name. - `Peers []string` A list of peer tags. - `SOASerial float64` The serial number of the SOA for the given zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) outgoing, err := client.DNS.ZoneTransfers.Outgoing.Update(context.TODO(), dns.ZoneTransferOutgoingUpdateParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), Name: cloudflare.F("www.example.com."), Peers: cloudflare.F([]string{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", outgoing.ID) } ``` #### 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": { "id": "269d8f4853475ca241c4e730be286b20", "checked_time": "2019-10-24T17:09:42.883908+01:00", "created_time": "2019-10-24T17:09:42.883908+01:00", "last_transferred_time": "2019-10-24T17:09:42.883908+01:00", "name": "www.example.com.", "peers": [ "23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194" ], "soa_serial": 2019102400 } } ``` ## Delete Primary Zone Configuration `client.DNS.ZoneTransfers.Outgoing.Delete(ctx, body) (*ZoneTransferOutgoingDeleteResponse, error)` **delete** `/zones/{zone_id}/secondary_dns/outgoing` Delete primary zone configuration for outgoing zone transfers. ### Parameters - `body ZoneTransferOutgoingDeleteParams` - `ZoneID param.Field[string]` ### Returns - `type ZoneTransferOutgoingDeleteResponse struct{…}` - `ID string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) outgoing, err := client.DNS.ZoneTransfers.Outgoing.Delete(context.TODO(), dns.ZoneTransferOutgoingDeleteParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", outgoing.ID) } ``` #### 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": { "id": "269d8f4853475ca241c4e730be286b20" } } ``` ## Disable Outgoing Zone Transfers `client.DNS.ZoneTransfers.Outgoing.Disable(ctx, params) (*DisableTransfer, error)` **post** `/zones/{zone_id}/secondary_dns/outgoing/disable` Disable outgoing zone transfers for primary zone and clears IXFR backlog of primary zone. ### Parameters - `params ZoneTransferOutgoingDisableParams` - `ZoneID param.Field[string]` Path param - `Body param.Field[unknown]` Body param ### Returns - `type DisableTransfer string` The zone transfer status of a primary zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) disableTransfer, err := client.DNS.ZoneTransfers.Outgoing.Disable(context.TODO(), dns.ZoneTransferOutgoingDisableParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), Body: map[string]interface{}{ }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", disableTransfer) } ``` #### 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": "Disabled" } ``` ## Enable Outgoing Zone Transfers `client.DNS.ZoneTransfers.Outgoing.Enable(ctx, params) (*EnableTransfer, error)` **post** `/zones/{zone_id}/secondary_dns/outgoing/enable` Enable outgoing zone transfers for primary zone. ### Parameters - `params ZoneTransferOutgoingEnableParams` - `ZoneID param.Field[string]` Path param - `Body param.Field[unknown]` Body param ### Returns - `type EnableTransfer string` The zone transfer status of a primary zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) enableTransfer, err := client.DNS.ZoneTransfers.Outgoing.Enable(context.TODO(), dns.ZoneTransferOutgoingEnableParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), Body: map[string]interface{}{ }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", enableTransfer) } ``` #### 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": "Enabled" } ``` ## Force DNS NOTIFY `client.DNS.ZoneTransfers.Outgoing.ForceNotify(ctx, params) (*string, error)` **post** `/zones/{zone_id}/secondary_dns/outgoing/force_notify` Notifies the secondary nameserver(s) and clears IXFR backlog of primary zone. ### Parameters - `params ZoneTransferOutgoingForceNotifyParams` - `ZoneID param.Field[string]` Path param - `Body param.Field[unknown]` Body param ### Returns - `type ZoneTransferOutgoingForceNotifyResponseEnvelopeResult string` When force_notify query parameter is set to true, the response is a simple string. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DNS.ZoneTransfers.Outgoing.ForceNotify(context.TODO(), dns.ZoneTransferOutgoingForceNotifyParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), Body: map[string]interface{}{ }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### 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": "OK" } ``` ## Domain Types ### Disable Transfer - `type DisableTransfer string` The zone transfer status of a primary zone. ### Enable Transfer - `type EnableTransfer string` The zone transfer status of a primary zone. ### Outgoing - `type Outgoing struct{…}` - `ID string` - `CheckedTime string` The time for a specific event. - `CreatedTime string` The time for a specific event. - `LastTransferredTime string` The time for a specific event. - `Name string` Zone name. - `Peers []string` A list of peer tags. - `SOASerial float64` The serial number of the SOA for the given zone. ### Outgoing Status - `type OutgoingStatus string` The zone transfer status of a primary zone. # Status ## Get Outgoing Zone Transfer Status `client.DNS.ZoneTransfers.Outgoing.Status.Get(ctx, query) (*EnableTransfer, error)` **get** `/zones/{zone_id}/secondary_dns/outgoing/status` Get primary zone transfer status. ### Parameters - `query ZoneTransferOutgoingStatusGetParams` - `ZoneID param.Field[string]` ### Returns - `type EnableTransfer string` The zone transfer status of a primary zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) enableTransfer, err := client.DNS.ZoneTransfers.Outgoing.Status.Get(context.TODO(), dns.ZoneTransferOutgoingStatusGetParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", enableTransfer) } ``` #### 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": "Enabled" } ``` # ACLs ## List ACLs `client.DNS.ZoneTransfers.ACLs.List(ctx, query) (*SinglePage[ACL], error)` **get** `/accounts/{account_id}/secondary_dns/acls` List ACLs. ### Parameters - `query ZoneTransferACLListParams` - `AccountID param.Field[string]` ### Returns - `type ACL struct{…}` - `ID string` - `IPRange string` Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively. - `Name string` The name of the acl. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.DNS.ZoneTransfers.ACLs.List(context.TODO(), dns.ZoneTransferACLListParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### 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": [ { "id": "23ff594956f20c2a721606e94745a8aa", "ip_range": "192.0.2.53/28", "name": "my-acl-1" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## ACL Details `client.DNS.ZoneTransfers.ACLs.Get(ctx, aclID, query) (*ACL, error)` **get** `/accounts/{account_id}/secondary_dns/acls/{acl_id}` Get ACL. ### Parameters - `aclID string` - `query ZoneTransferACLGetParams` - `AccountID param.Field[string]` ### Returns - `type ACL struct{…}` - `ID string` - `IPRange string` Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively. - `Name string` The name of the acl. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) acl, err := client.DNS.ZoneTransfers.ACLs.Get( context.TODO(), "23ff594956f20c2a721606e94745a8aa", dns.ZoneTransferACLGetParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", acl.ID) } ``` #### 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": { "id": "23ff594956f20c2a721606e94745a8aa", "ip_range": "192.0.2.53/28", "name": "my-acl-1" } } ``` ## Create ACL `client.DNS.ZoneTransfers.ACLs.New(ctx, params) (*ACL, error)` **post** `/accounts/{account_id}/secondary_dns/acls` Create ACL. ### Parameters - `params ZoneTransferACLNewParams` - `AccountID param.Field[string]` Path param - `IPRange param.Field[string]` Body param: Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively. - `Name param.Field[string]` Body param: The name of the acl. ### Returns - `type ACL struct{…}` - `ID string` - `IPRange string` Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively. - `Name string` The name of the acl. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) acl, err := client.DNS.ZoneTransfers.ACLs.New(context.TODO(), dns.ZoneTransferACLNewParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), IPRange: cloudflare.F("192.0.2.53/28"), Name: cloudflare.F("my-acl-1"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", acl.ID) } ``` #### 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": { "id": "23ff594956f20c2a721606e94745a8aa", "ip_range": "192.0.2.53/28", "name": "my-acl-1" } } ``` ## Update ACL `client.DNS.ZoneTransfers.ACLs.Update(ctx, aclID, params) (*ACL, error)` **put** `/accounts/{account_id}/secondary_dns/acls/{acl_id}` Modify ACL. ### Parameters - `aclID string` - `params ZoneTransferACLUpdateParams` - `AccountID param.Field[string]` Path param - `ACL param.Field[ACL]` Body param ### Returns - `type ACL struct{…}` - `ID string` - `IPRange string` Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively. - `Name string` The name of the acl. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) acl, err := client.DNS.ZoneTransfers.ACLs.Update( context.TODO(), "23ff594956f20c2a721606e94745a8aa", dns.ZoneTransferACLUpdateParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), ACL: dns.ACLParam{ IPRange: cloudflare.F("192.0.2.53/28"), Name: cloudflare.F("my-acl-1"), }, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", acl.ID) } ``` #### 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": { "id": "23ff594956f20c2a721606e94745a8aa", "ip_range": "192.0.2.53/28", "name": "my-acl-1" } } ``` ## Delete ACL `client.DNS.ZoneTransfers.ACLs.Delete(ctx, aclID, body) (*ZoneTransferACLDeleteResponse, error)` **delete** `/accounts/{account_id}/secondary_dns/acls/{acl_id}` Delete ACL. ### Parameters - `aclID string` - `body ZoneTransferACLDeleteParams` - `AccountID param.Field[string]` ### Returns - `type ZoneTransferACLDeleteResponse struct{…}` - `ID string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) acl, err := client.DNS.ZoneTransfers.ACLs.Delete( context.TODO(), "23ff594956f20c2a721606e94745a8aa", dns.ZoneTransferACLDeleteParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", acl.ID) } ``` #### 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": { "id": "23ff594956f20c2a721606e94745a8aa" } } ``` ## Domain Types ### ACL - `type ACL struct{…}` - `ID string` - `IPRange string` Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively. - `Name string` The name of the acl. # Peers ## List Peers `client.DNS.ZoneTransfers.Peers.List(ctx, query) (*SinglePage[Peer], error)` **get** `/accounts/{account_id}/secondary_dns/peers` List Peers. ### Parameters - `query ZoneTransferPeerListParams` - `AccountID param.Field[string]` ### Returns - `type Peer struct{…}` - `ID string` - `Name string` The name of the peer. - `IP string` IPv4/IPv6 address of primary or secondary nameserver, depending on what zone this peer is linked to. For primary zones this IP defines the IP of the secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary zones this IP defines the IP of the primary nameserver Cloudflare will send AXFR/IXFR requests to. - `IxfrEnable bool` Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary zones. - `Port float64` DNS port of primary or secondary nameserver, depending on what zone this peer is linked to. - `TSIGID string` TSIG authentication will be used for zone transfer if configured. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.DNS.ZoneTransfers.Peers.List(context.TODO(), dns.ZoneTransferPeerListParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### 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": [ { "id": "23ff594956f20c2a721606e94745a8aa", "name": "my-peer-1", "ip": "192.0.2.53", "ixfr_enable": false, "port": 53, "tsig_id": "69cd1e104af3e6ed3cb344f263fd0d5a" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Peer Details `client.DNS.ZoneTransfers.Peers.Get(ctx, peerID, query) (*Peer, error)` **get** `/accounts/{account_id}/secondary_dns/peers/{peer_id}` Get Peer. ### Parameters - `peerID string` - `query ZoneTransferPeerGetParams` - `AccountID param.Field[string]` ### Returns - `type Peer struct{…}` - `ID string` - `Name string` The name of the peer. - `IP string` IPv4/IPv6 address of primary or secondary nameserver, depending on what zone this peer is linked to. For primary zones this IP defines the IP of the secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary zones this IP defines the IP of the primary nameserver Cloudflare will send AXFR/IXFR requests to. - `IxfrEnable bool` Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary zones. - `Port float64` DNS port of primary or secondary nameserver, depending on what zone this peer is linked to. - `TSIGID string` TSIG authentication will be used for zone transfer if configured. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) peer, err := client.DNS.ZoneTransfers.Peers.Get( context.TODO(), "23ff594956f20c2a721606e94745a8aa", dns.ZoneTransferPeerGetParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", peer.ID) } ``` #### 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": { "id": "23ff594956f20c2a721606e94745a8aa", "name": "my-peer-1", "ip": "192.0.2.53", "ixfr_enable": false, "port": 53, "tsig_id": "69cd1e104af3e6ed3cb344f263fd0d5a" } } ``` ## Create Peer `client.DNS.ZoneTransfers.Peers.New(ctx, params) (*Peer, error)` **post** `/accounts/{account_id}/secondary_dns/peers` Create Peer. ### Parameters - `params ZoneTransferPeerNewParams` - `AccountID param.Field[string]` Path param - `Name param.Field[string]` Body param: The name of the peer. ### Returns - `type Peer struct{…}` - `ID string` - `Name string` The name of the peer. - `IP string` IPv4/IPv6 address of primary or secondary nameserver, depending on what zone this peer is linked to. For primary zones this IP defines the IP of the secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary zones this IP defines the IP of the primary nameserver Cloudflare will send AXFR/IXFR requests to. - `IxfrEnable bool` Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary zones. - `Port float64` DNS port of primary or secondary nameserver, depending on what zone this peer is linked to. - `TSIGID string` TSIG authentication will be used for zone transfer if configured. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) peer, err := client.DNS.ZoneTransfers.Peers.New(context.TODO(), dns.ZoneTransferPeerNewParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), Name: cloudflare.F("my-peer-1"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", peer.ID) } ``` #### 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": { "id": "23ff594956f20c2a721606e94745a8aa", "name": "my-peer-1", "ip": "192.0.2.53", "ixfr_enable": false, "port": 53, "tsig_id": "69cd1e104af3e6ed3cb344f263fd0d5a" } } ``` ## Update Peer `client.DNS.ZoneTransfers.Peers.Update(ctx, peerID, params) (*Peer, error)` **put** `/accounts/{account_id}/secondary_dns/peers/{peer_id}` Modify Peer. ### Parameters - `peerID string` - `params ZoneTransferPeerUpdateParams` - `AccountID param.Field[string]` Path param - `Peer param.Field[Peer]` Body param ### Returns - `type Peer struct{…}` - `ID string` - `Name string` The name of the peer. - `IP string` IPv4/IPv6 address of primary or secondary nameserver, depending on what zone this peer is linked to. For primary zones this IP defines the IP of the secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary zones this IP defines the IP of the primary nameserver Cloudflare will send AXFR/IXFR requests to. - `IxfrEnable bool` Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary zones. - `Port float64` DNS port of primary or secondary nameserver, depending on what zone this peer is linked to. - `TSIGID string` TSIG authentication will be used for zone transfer if configured. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) peer, err := client.DNS.ZoneTransfers.Peers.Update( context.TODO(), "23ff594956f20c2a721606e94745a8aa", dns.ZoneTransferPeerUpdateParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), Peer: dns.PeerParam{ Name: cloudflare.F("my-peer-1"), }, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", peer.ID) } ``` #### 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": { "id": "23ff594956f20c2a721606e94745a8aa", "name": "my-peer-1", "ip": "192.0.2.53", "ixfr_enable": false, "port": 53, "tsig_id": "69cd1e104af3e6ed3cb344f263fd0d5a" } } ``` ## Delete Peer `client.DNS.ZoneTransfers.Peers.Delete(ctx, peerID, body) (*ZoneTransferPeerDeleteResponse, error)` **delete** `/accounts/{account_id}/secondary_dns/peers/{peer_id}` Delete Peer. ### Parameters - `peerID string` - `body ZoneTransferPeerDeleteParams` - `AccountID param.Field[string]` ### Returns - `type ZoneTransferPeerDeleteResponse struct{…}` - `ID string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) peer, err := client.DNS.ZoneTransfers.Peers.Delete( context.TODO(), "23ff594956f20c2a721606e94745a8aa", dns.ZoneTransferPeerDeleteParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", peer.ID) } ``` #### 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": { "id": "23ff594956f20c2a721606e94745a8aa" } } ``` ## Domain Types ### Peer - `type Peer struct{…}` - `ID string` - `Name string` The name of the peer. - `IP string` IPv4/IPv6 address of primary or secondary nameserver, depending on what zone this peer is linked to. For primary zones this IP defines the IP of the secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary zones this IP defines the IP of the primary nameserver Cloudflare will send AXFR/IXFR requests to. - `IxfrEnable bool` Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary zones. - `Port float64` DNS port of primary or secondary nameserver, depending on what zone this peer is linked to. - `TSIGID string` TSIG authentication will be used for zone transfer if configured. # TSIGs ## List TSIGs `client.DNS.ZoneTransfers.TSIGs.List(ctx, query) (*SinglePage[TSIG], error)` **get** `/accounts/{account_id}/secondary_dns/tsigs` List TSIGs. ### Parameters - `query ZoneTransferTSIGListParams` - `AccountID param.Field[string]` ### Returns - `type TSIG struct{…}` - `ID string` - `Algo string` TSIG algorithm. - `Name string` TSIG key name. - `Secret string` TSIG secret. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.DNS.ZoneTransfers.TSIGs.List(context.TODO(), dns.ZoneTransferTSIGListParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### 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": [ { "id": "69cd1e104af3e6ed3cb344f263fd0d5a", "algo": "hmac-sha512.", "name": "tsig.customer.cf.", "secret": "caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## TSIG Details `client.DNS.ZoneTransfers.TSIGs.Get(ctx, tsigID, query) (*TSIG, error)` **get** `/accounts/{account_id}/secondary_dns/tsigs/{tsig_id}` Get TSIG. ### Parameters - `tsigID string` - `query ZoneTransferTSIGGetParams` - `AccountID param.Field[string]` ### Returns - `type TSIG struct{…}` - `ID string` - `Algo string` TSIG algorithm. - `Name string` TSIG key name. - `Secret string` TSIG secret. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) tsig, err := client.DNS.ZoneTransfers.TSIGs.Get( context.TODO(), "69cd1e104af3e6ed3cb344f263fd0d5a", dns.ZoneTransferTSIGGetParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", tsig.ID) } ``` #### 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": { "id": "69cd1e104af3e6ed3cb344f263fd0d5a", "algo": "hmac-sha512.", "name": "tsig.customer.cf.", "secret": "caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c" } } ``` ## Create TSIG `client.DNS.ZoneTransfers.TSIGs.New(ctx, params) (*TSIG, error)` **post** `/accounts/{account_id}/secondary_dns/tsigs` Create TSIG. ### Parameters - `params ZoneTransferTSIGNewParams` - `AccountID param.Field[string]` Path param - `TSIG param.Field[TSIG]` Body param ### Returns - `type TSIG struct{…}` - `ID string` - `Algo string` TSIG algorithm. - `Name string` TSIG key name. - `Secret string` TSIG secret. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) tsig, err := client.DNS.ZoneTransfers.TSIGs.New(context.TODO(), dns.ZoneTransferTSIGNewParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), TSIG: dns.TSIGParam{ Algo: cloudflare.F("hmac-sha512."), Name: cloudflare.F("tsig.customer.cf."), Secret: cloudflare.F("caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c"), }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", tsig.ID) } ``` #### 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": { "id": "69cd1e104af3e6ed3cb344f263fd0d5a", "algo": "hmac-sha512.", "name": "tsig.customer.cf.", "secret": "caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c" } } ``` ## Update TSIG `client.DNS.ZoneTransfers.TSIGs.Update(ctx, tsigID, params) (*TSIG, error)` **put** `/accounts/{account_id}/secondary_dns/tsigs/{tsig_id}` Modify TSIG. ### Parameters - `tsigID string` - `params ZoneTransferTSIGUpdateParams` - `AccountID param.Field[string]` Path param - `TSIG param.Field[TSIG]` Body param ### Returns - `type TSIG struct{…}` - `ID string` - `Algo string` TSIG algorithm. - `Name string` TSIG key name. - `Secret string` TSIG secret. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) tsig, err := client.DNS.ZoneTransfers.TSIGs.Update( context.TODO(), "69cd1e104af3e6ed3cb344f263fd0d5a", dns.ZoneTransferTSIGUpdateParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), TSIG: dns.TSIGParam{ Algo: cloudflare.F("hmac-sha512."), Name: cloudflare.F("tsig.customer.cf."), Secret: cloudflare.F("caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c"), }, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", tsig.ID) } ``` #### 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": { "id": "69cd1e104af3e6ed3cb344f263fd0d5a", "algo": "hmac-sha512.", "name": "tsig.customer.cf.", "secret": "caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c" } } ``` ## Delete TSIG `client.DNS.ZoneTransfers.TSIGs.Delete(ctx, tsigID, body) (*ZoneTransferTSIGDeleteResponse, error)` **delete** `/accounts/{account_id}/secondary_dns/tsigs/{tsig_id}` Delete TSIG. ### Parameters - `tsigID string` - `body ZoneTransferTSIGDeleteParams` - `AccountID param.Field[string]` ### Returns - `type ZoneTransferTSIGDeleteResponse struct{…}` - `ID string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) tsig, err := client.DNS.ZoneTransfers.TSIGs.Delete( context.TODO(), "69cd1e104af3e6ed3cb344f263fd0d5a", dns.ZoneTransferTSIGDeleteParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", tsig.ID) } ``` #### 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": { "id": "69cd1e104af3e6ed3cb344f263fd0d5a" } } ``` ## Domain Types ### TSIG - `type TSIG struct{…}` - `ID string` - `Algo string` TSIG algorithm. - `Name string` TSIG key name. - `Secret string` TSIG secret.