tencent cloud

文档反馈

CreateDnsRecord

最后更新时间:2022-09-28 19:28:20
This document is currently invalid. Please refer to the documentation page of the product.

1. API Description

Domain name for API request: teo.tencentcloudapi.com.

This API is used to create a DNS record.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: CreateDnsRecord.
Version Yes String Common Params. The value used for this API: 2022-09-01.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
ZoneId Yes String The site ID of the DNS record.
Type Yes String The DNS record type. Values:
  • A: Point a domain name to an IPv4 address, such as 8.8.8.8.
  • AAAA: Point a domain name to an IPv6 address.
  • MX: It is used for email servers. The record value and priority parameters are provided by email service providers. If there are multiple MX records, the lower the priority value, the higher the priority.
  • CNAME: Point a domain name to another domain name that can be resolved to an IP address.
  • TXT: Identify and describe a domain name. It is usually used for domain verification and as SPF records (for anti-spam).
  • NS: If you need to authorize a subdomain name to another DNS service provider for DNS resolution, you need to add an NS record. You cannot add an NS record for a root domain name.
  • CAA: Specify CAs to issue certificates for sites.
  • SRV: Identify a service used by a server. It is commonly used in Microsoft directory management.
  • Name Yes String The DNS record name.
    Content Yes String The DNS record content.
    Mode Yes String The proxy mode. Values:
  • dns_only: Only DNS
  • proxied: Proxied
  • TTL No Integer TTL (in seconds). The smaller the value, the faster the record changes take effect. Default value: 300
    Priority No Integer Specifies a value in the range 1–50 when you make changes to the MX records. A smaller value indicates higher priority. Note that the default value 0 will be used if this field is not specified.

    3. Output Parameters

    Parameter Name Type Description
    DnsRecordId String The DNS record ID.
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Creating a DNS record

    Input Example

    POST / HTTP/1.1
    Host: teo.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: CreateDnsRecord
    <Common request parameters>
    
    {
        "Priority": 1,
        "Name": "www.example.com",
        "ZoneId": "zone-225qgrnvbi9w",
        "Content": "1.2.3.4",
        "Mode": "dns",
        "TTL": 300,
        "Type": "A"
    }
    

    Output Example

    {
        "Response": {
            "RequestId": "5e0a2b4e-df6d-4d2a-ac39-1706cbf8a707",
            "DnsRecordId": "record-225rcy8bw85g"
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    InvalidParameterValue.ConflictRecord It conflicts with existing records.
    InvalidParameterValue.ConflictWithDNSSEC DNS records conflict with DNSSEC.
    InvalidParameterValue.ConflictWithLBRecord This DNS record conflicts with CLB records.
    InvalidParameterValue.ConflictWithNSRecord This DNS record conflicts with NS records.
    InvalidParameterValue.InvalidDNSContent Incorrect DNS record
    InvalidParameterValue.InvalidDNSName Incorrect DNS CNAME
    InvalidParameterValue.InvalidProxyName Incorrect DNS proxied domain name.
    InvalidParameterValue.InvalidProxyOrigin Incorrect DNS proxy
    InvalidParameterValue.RecordAlreadyExists This record already exists.
    InvalidParameterValue.RecordNotAllowed This record cannot be added.
    OperationDenied Operation denied.
    OperationDenied.DomainNoICP The domain name doesn't have an ICP filing number.
    ResourceNotFound The resource doesn’t exist.
    UnauthorizedOperation.CamUnauthorized CAM is not authorized.