DNS API v2 Information

Welcome to the Sitelutions DNS API v2. This API is built on our new, high-performance platform and is designed to provide maximum flexibility for our advanced users.

With this system, you can perform bulk updates, manage records programmatically, and create custom applications that integrate directly with our DNS infrastructure, all with enhanced security and speed.

Critical Changes from API v1

If you are migrating from our legacy V1 API, please note these two critical changes:

  1. New Endpoint: The API endpoint has moved. The new endpoint URL is:
    https://api2.sitelutions.com/soap-api
  2. New Authentication: For improved security, the V2 API no longer uses your account password. You must now authenticate using a dedicated API Key.
    You can generate and manage your API keys from the "API Keys" section on your main DNS Management page.

API Access

Gaining access to the API requires a subscription to the Sitelutions Insider's Club with Premium DNS. Unfortunately, this also means that termination of the membership will automatically terminate API access. Luckily, being a member offers many additional benefits; from discounts to increased services to greater support. Visit the club page for more information.

API Endpoint & Namespace

Our API runs in non-WSDL mode. You must provide the location (the endpoint URL) and uri (the namespace) when initializing your SOAP client.

  • SOAP Endpoint (Location): https://api2.sitelutions.com/soap-api
  • Namespace (URI): https://api2.sitelutions.com/soap/v2

PHP SOAP Client Examples

The following examples demonstrate how to connect to the V2 API using PHP's built-in SoapClient in non-WSDL mode. Remember to replace YOUR_EMAIL and YOUR_API_KEY with your credentials.

Example 1: List All Your DNS Domains

Retrieves a list of all domain zones (tbl_client_cf_zones) associated with your account.

<?php
try {
    $email = 'YOUR_EMAIL';
    $apiKey = 'YOUR_API_KEY'; // This is your new API Key, not your password
    $apiUrl = 'https://api2.sitelutions.com/soap-api';
    $namespaceUri = 'https://api2.sitelutions.com/soap/v2';

    $client = new SoapClient(null, [
        'location' => $apiUrl,
        'uri' => $namespaceUri,
        'soap_version' => SOAP_1_1,
        'exceptions' => true,
        'trace' => 1
    ]);

    $domains = $client->listDomains($email, $apiKey);

    echo "Successfully retrieved domains:\n";
    print_r($domains);

} catch (SoapFault $e) {
    echo "SOAP Error: " . $e->getMessage() . "\n";
}
?>

Example 2: Get a Single Domain by Name

Retrieves the details for a specific domain zone by its name.

<?php
try {
    $email = 'YOUR_EMAIL';
    $apiKey = 'YOUR_API_KEY';
    $domainName = 'example.com';
    $apiUrl = 'https://api2.sitelutions.com/soap-api';
    $namespaceUri = 'https://api2.sitelutions.com/soap/v2';

    $client = new SoapClient(null, [
        'location' => $apiUrl,
        'uri' => $namespaceUri,
        'soap_version' => SOAP_1_1,
        'exceptions' => true
    ]);

    $domain = $client->getDomainByName($email, $apiKey, $domainName);

    echo "Domain details:\n";
    print_r($domain);

} catch (SoapFault $e) {
    echo "SOAP Error: " . $e->getMessage() . "\n";
}
?>

Example 3: Get a Single Domain by ID

Retrieves the details for a specific domain zone by its unique ID (the id returned from listDomains).

<?php
try {
    $email = 'YOUR_EMAIL';
    $apiKey = 'YOUR_API_KEY';
    $domainId = ''; // Your zone_id // https://sitelutions.com/index.php?m=sitelutions_dns&action=managedns_cf&zone_id=f4c9bad6bbaeyf744fxd332e638b3d11
    $apiUrl = 'https://api2.sitelutions.com/soap-api';
    $namespaceUri = 'https://api2.sitelutions.com/soap/v2';

    $client = new SoapClient(null, [
        'location' => $apiUrl,
        'uri' => $namespaceUri,
        'soap_version' => SOAP_1_1,
        'exceptions' => true
    ]);

    $domain = $client->getDomainByID($email, $apiKey, $domainId);

    echo "Domain details:\n";
    print_r($domain);

} catch (SoapFault $e) {
    echo "SOAP Error: " . $e->getMessage() . "\n";
}
?>

Example 4: List All DNS Records (RRs) for a Domain

Retrieves a full list of all DNS records and redirection rules for a specific domain ID.

<?php
try {
    $email = 'YOUR_EMAIL';
    $apiKey = 'YOUR_API_KEY';
    $domainId = ''; // Your zone_id // https://sitelutions.com/index.php?m=sitelutions_dns&action=managedns_cf&zone_id=f4c9bad6bbaeyf744fxd332e638b3d11
    $apiUrl = 'https://api2.sitelutions.com/soap-api';
    $namespaceUri = 'https://api2.sitelutions.com/soap/v2';

    $client = new SoapClient(null, [
        'location' => $apiUrl,
        'uri' => $namespaceUri,
        'soap_version' => SOAP_1_1,
        'exceptions' => true
    ]);

    $records = $client->listRRsByDomain($email, $apiKey, $domainId);

    echo "Records for Domain ID {$domainId}:\n";
    print_r($records);

} catch (SoapFault $e) {
    echo "SOAP Error: " . $e->getMessage() . "\n";
}
?>

Example 5: Get a Single DNS Record by ID

Retrieves the details for a single DNS record using its unique platform record ID (the id returned from listRRsByDomain).

<?php
try {
    $email = 'YOUR_EMAIL';
    $apiKey = 'YOUR_API_KEY';
    $domainId = ''; // Your zone_id // https://sitelutions.com/index.php?m=sitelutions_dns&action=managedns_cf&zone_id=f4c9bad6bbaeyf744fxd332e638b3d11
    $recordId = '4cc8fd4337dd7e7a72df84d824acbd14'; // The 32-char record ID
    $apiUrl = 'https://api2.sitelutions.com/soap-api';
    $namespaceUri = 'https://api2.sitelutions.com/soap/v2';

    $client = new SoapClient(null, [
        'location' => $apiUrl,
        'uri' => $namespaceUri,
        'soap_version' => SOAP_1_1,
        'exceptions' => true
    ]);

    $record = $client->getRRByID($email, $apiKey, $domainId, $recordId);

    echo "Record details:\n";
    print_r($record);

} catch (SoapFault $e) {
    echo "SOAP Error: " . $e->getMessage() . "\n";
}
?>

Example 6: Add DNS Records (A, MX, and SRV)

This function queues a request to add a new DNS record. Note how different record types (like SRV) use a data object instead of content and priority.

<?php
try {
    $email = 'YOUR_EMAIL';
    $apiKey = 'YOUR_API_KEY';
    $domainId = ''; // Your zone_id // https://sitelutions.com/index.php?m=sitelutions_dns&action=managedns_cf&zone_id=f4c9bad6bbaeyf744fxd332e638b3d11
    $apiUrl = 'https://api2.sitelutions.com/soap-api';
    $namespaceUri = 'https://api2.sitelutions.com/soap/v2';

    $client = new SoapClient(null, [
        'location' => $apiUrl,
        'uri' => $namespaceUri,
        'soap_version' => SOAP_1_1,
        'exceptions' => true
    ]);

    // --- Example 6a: Add an 'A' Record ---
    $resultA = $client->addRR(
        $email,
        $apiKey,
        $domainId,
        '192.0.2.1',  // data (content)
        'A',          // type
        'www',        // hostname
        3600,         // ttl
        null          // priority (not used for A)
    );
    echo "A Record Queued: " . $resultA . "\n";
    
    // --- Example 6b: Add an 'MX' Record ---
    $resultMX = $client->addRR(
        $email,
        $apiKey,
        $domainId,
        'mail.example.com', // data (content)
        'MX',               // type
        '@',                // hostname
        3600,               // ttl
        10                  // priority
    );
    echo "MX Record Queued: " . $resultMX . "\n";

    // --- Example 6c: Add an 'SRV' Record ---
    $srvData = [
        'service' => '_sip',
        'proto' => '_tcp',
        'name' => 'example.com', // The domain name
        'priority' => 10, // SRV Priority (inside data)
        'weight' => 5,
        'port' => 5060,
        'target' => 'sip.provider.com'
    ];
    
    $resultSRV = $client->addRR(
        $email,
        $apiKey,
        $domainId,
        json_encode($srvData), // SRV data object is JSON-encoded
        'SRV',                 // type
        '_sip._tcp',           // hostname
        3600,                  // ttl
        10                     // Main record priority (matches SRV priority)
    );
    echo "SRV Record Queued: " . $resultSRV . "\n";

} catch (SoapFault $e) {
    echo "SOAP Error: " . $e->getMessage() . "\n";
}
?>

Example 7: Update a DNS Record

This function queues a request to update an existing DNS record. Only non-null parameters will be updated. This example only updates the content and ttl.

<?php
try {
    $email = 'YOUR_EMAIL';
    $apiKey = 'YOUR_API_KEY';
    $domainId = ''; // Your zone_id // https://sitelutions.com/index.php?m=sitelutions_dns&action=managedns_cf&zone_id=f4c9bad6bbaeyf744fxd332e638b3d11
    $recordId = '4cc8fd4337dd7e7a72df84d824acbd14'; // The 32-char record ID
    $apiUrl = 'https://api2.sitelutions.com/soap-api';
    $namespaceUri = 'https://api2.sitelutions.com/soap/v2';

    $client = new SoapClient(null, [
        'location' => $apiUrl,
        'uri' => $namespaceUri,
        'soap_version' => SOAP_1_1,
        'exceptions' => true
    ]);

    $result = $client->updateRR(
        $email,
        $apiKey,
        $domainId,
        $recordId,
        300,          // ttl
        '198.51.100.1', // data
        null          // priority (pass null to leave unchanged)
    );
    
    echo "Update request queued:\n";
    print_r($result);

} catch (SoapFault $e) {
    echo "SOAP Error: " . $e->getMessage() . "\n";
}
?>

Example 8: Delete a DNS Record

This function queues a request to delete an existing DNS record by its ID.

<?php
try {
    $email = 'YOUR_EMAIL';
    $apiKey = 'YOUR_API_KEY';
    $domainId = ''; // Your zone_id // https://sitelutions.com/index.php?m=sitelutions_dns&action=managedns_cf&zone_id=f4c9bad6bbaeyf744fxd332e638b3d11
    $recordId = '4cc8fd4337dd7e7a72df84d824acbd14'; // The 32-char record ID
    $apiUrl = 'https://api2.sitelutions.com/soap-api';
    $namespaceUri = 'https://api2.sitelutions.com/soap/v2';

    $client = new SoapClient(null, [
        'location' => $apiUrl,
        'uri' => $namespaceUri,
        'soap_version' => SOAP_1_1,
        'exceptions' => true
    ]);

    $result = $client->deleteRR($email, $apiKey, $domainId, $recordId);
    
    echo "Delete request queued:\n";
    print_r($result);

} catch (SoapFault $e) {
    echo "SOAP Error: " . $e->getMessage() . "\n";
}
?>

Example 9: Add a New Domain Zone

This function queues a request to add a new domain zone to your account. Note: This function will fail unless the domain's nameservers are already pointing to ns6.sitelutions.com and ns7.sitelutions.com.

<?php
try {
    $email = 'YOUR_EMAIL';
    $apiKey = 'YOUR_API_KEY';
    $domainName = 'new-domain-to-add.com';
    $apiUrl = 'https://api2.sitelutions.com/soap-api';
    $namespaceUri = 'https://api2.sitelutions.com/soap/v2';

    $client = new SoapClient(null, [
        'location' => $apiUrl,
        'uri' => $namespaceUri,
        'soap_version' => SOAP_1_1,
        'exceptions' => true
    ]);

    $newDomainId = $client->addDomain($email, $apiKey, $domainName);

    echo "Add Domain request queued. New Domain ID: " . $newDomainId . "\n";

} catch (SoapFault $e) {
    echo "SOAP Error: " . $e->getMessage() . "\n";
}
?>

Example 10: Delete a Domain Zone

This function queues a request to delete an entire domain zone and all its records from the V2 platform.

<?php
try {
    $email = 'YOUR_EMAIL';
    $apiKey = 'YOUR_API_KEY';
    $domainId = ''; // Your zone_id // https://sitelutions.com/index.php?m=sitelutions_dns&action=managedns_cf&zone_id=f4c9bad6bbaeyf744fxd332e638b3d11
    $confirmation = 'true'; // Must be a non-empty, non-zero value
    $apiUrl = 'https://api2.sitelutions.com/soap-api';
    $namespaceUri = 'https://api2.sitelutions.com/soap/v2';

    $client = new SoapClient(null, [
        'location' => $apiUrl,
        'uri' => $namespaceUri,
        'soap_version' => SOAP_1_1,
        'exceptions' => true
    ]);

    $result = $client->deleteDomain($email, $apiKey, $domainId, $confirmation);
    
    echo "Delete Domain request queued:\n";
    print_r($result);

} catch (SoapFault $e) {
    echo "SOAP Error: " . $e->getMessage() . "\n";
}
?>

A Note on API Updates

The API is constantly under development and may be prone to updates. However, we will always announce all updates through the site.

Also bear in mind that any update could issue changes to current functions (such as parameter additions), potentially disrupting services. We will do our best to ensure that this scenario does not happen, and that full backwards-compatibility is maintained when changes are made. We will also highlight any changes within a changelog in the event that service-impacting modifications become inevitable.

Was this answer helpful? 0 Users Found This Useful (0 Votes)