add_dns_settings()

Create a DNS resource record.

All API functions DNS Settings

Signature

add_dns_settings(array $parameters): mixed

Parameters

Pass these parameters as KasRequestParams. Every request also requires kas_login, kas_auth_type, and kas_auth_data, as shown in SOAP with PHP.

Name Description Requirement
zone_host The zone Required
record_type The TYPE of the resource record (MX, A, AAAA, and so on) Required
record_name The NAME of the resource record Required
record_data The DATA of the resource record Required
record_aux The AUX value of the resource record Required

PHP example

<?php

// $sessionToken is returned by KasAuth, see SOAP with PHP.
$parameters = [
    'record_name' => 'sub',
    'record_type' => 'A',
    'record_data' => '1.2.3.4',
    'record_aux' => '0',
    'zone_host' => 'example.com.',
];

try {
    $client = new SoapClient('https://kasapi.kasserver.com/soap/wsdl/KasApi.wsdl');
    $response = $client->KasApi(json_encode([
        'kas_login' => 'w0123456',
        'kas_auth_type' => 'session',
        'kas_auth_data' => $sessionToken,
        'kas_action' => 'add_dns_settings',
        'KasRequestParams' => $parameters,
    ]));
    print_r($response);
} catch (SoapFault $fault) {
    echo 'Error: ' . $fault->faultstring;
}

Responses and error codes

  • TRUE the action was carried out
  • missing_parameter a required parameter is missing
  • dns_settings_not_allowed
  • record_already_exists
  • record_already_exists_as_non_cname
  • record_aux_syntax_incorrect
  • record_has_ssl_certificate
  • record_name_syntax_incorrect
  • record_syntax_incorrect
  • zone_not_found
  • zone_syntax_incorrect