API Module Nameserver createZoneDnsRequest

From Openprovider API documentation

Jump to: navigation, search

Contents

Module DNS zone > Create

Module DNS zone
Command name createZoneDnsRequest
Use Creates a new DNS zone object
Input
  • domain
  • type (master or slave)
  • masterIp (required for type = slave)
  • records (required for type = master)
  • templateName
  • isSpamexpertsEnabled (to enable spam filtering by default on this DNS zone, default value: 0)
  • secured (0 or 1, default value is 0) - is needed to create DNSSEC keys for zone
  • provider (openprovider or sectigo, default value is openprovider) - is needed to create a free or premium DNS zone
Output

-

Examples

Using PHP class

$request = new OP_Request;
$request->setCommand('createZoneDnsRequest')
  ->setAuth(array('username' => 'username', 'password' => 'password'))
  ->setArgs(array(
    'domain' => array(
      'name' => 'demozone',
      'extension' => 'com'
    ),
    'type' => 'master',
    'records' => array(
      array(
        'type' => 'A',
        'name' => "",
        'value' => '89.255.0.43',
        'ttl' => 86400
      ),
      array(
        'type' => 'A',
        'name' => '*',
        'value' => '89.255.0.43',
        'ttl' => 86400
      ),
      array(
        'type' => 'MX',
        'name' => "",
        'value' => 'mail.openprovider.eu',
        'prio' => 10,
        'ttl' => 86400
      )
    )
  ));

Raw XML

Please note that newlines and leading spaces are added only for readability. Those whitespaces should be excluded from your XML command before sending it to Openprovider.

<?xml version="1.0" encoding="UTF-8"?>
<openXML>
  <credentials>
    <username>username</username>
    <password>password</password>
  </credentials>
  <createZoneDnsRequest>
    <domain>
      <name>demozone</name>
      <extension>com</extension>
    </domain>
    <type>master</type>
    <records>
      <array>
        <item>
          <type>A</type>
          <name></name>
          <value>89.255.0.43</value>
          <ttl>86400</ttl>
        </item>
        <item>
          <type>A</type>
          <name>*</name>
          <value>89.255.0.43</value>
          <ttl>86400</ttl>
        </item>
        <item>
          <type>MX</type>
          <name></name>
          <value>mail.openprovider.eu</value>
          <prio>10</prio>
          <ttl>86400</ttl>
        </item>
      </array>
    </records>
  </createZoneDnsRequest>
</openXML>
<?xml version="1.0" encoding="UTF-8"?>
<openXML>
  <reply>
    <code>0</code>
    <desc></desc>
    <data>1</data>
  </reply>
</openXML>
Views
Personal tools