pem.createDNSRecord

This method is supported by Operations starting from version 2.6.1 Hotfix 4.

This method creates new DNS Record for a particular Domain. Method returns DNS Record ID. The caller should keep track of DNS Record IDs in order to be able to delete them later by pem.deleteDNSRecord.

The method has the following input parameters:

Name

Type

Short Description

domain_name

string

Name of the Domain to create DNS Record for.

host

string

Host part of the DNS Record.

Note: For SRV and TLSA DNS records, this parameter should be specified in the following format: _SERVICE._PROTOCOL or *._PROTOCOL where _SERVICE is the port of the service and _PROTOCOL is the protocol of the service (TCP or UDP). For example: _443._tcp, *._udp.

[ttl]

int

Optional DNS Record's TTL.

type

string

DNS Record type. There are the following options:

  • AA DNS Record is created.
  • AAAAAAAA DNS Record is created.
  • CAACAA DNS Record is created.
  • CNAMECNAME DNS Record is created.
  • TLSATLSA DNS Record is created.
  • TXTTXT DNS Record is created.
  • MXMX DNS Record is created.
  • SRVSRV DNS Record is created.
  • NSNS DNS Record is created.

data

string

Actual data content. There are the following options:

  • For A DNS Record: IP Address should be specified, for example 1.1.1.1
  • For CAA DNS Record: Flag, Tag, and Value should be specified. For example: 0 issue "ca.example.net; account=123456"
  • For CNAME DNS Record: Canonical name should be specified, for example name
  • For TLSA DNS Record: Certificate Usage, Selector, Matching Type, and Certificate Association Data should be specified. For example: 0 0 1 EFDDF0D915C7BDC5782C0881E1B2A95AD099FBDD06D7B1F77982D9364338D955
  • For TXT DNS Record: Data should be specified, for example v=spf1 a mx
  • For MX DNS Record: Mail exchanger and preference should be specified, for example 10 mailexchanger.domain.acom
  • For SRV DNS Record: Priority, Weight, Port, and Target should be specified. For example 10 65535 10000 service.domain.acom
  • For NS DNS Record: Name server should be specified, for example nameserver

The method has the following output parameter.

Name

Type

Short Description

record_id

int

ID of the created DNS Record.

Note: Starting from Operations 2.6.4 this method can also be called under Reseller permissions.