adding an a record with remoting interface

Discussion in 'General' started by saco721, Jul 28, 2016.

  1. saco721

    saco721 Member

    Hi,
    I am in the process of adding a new a record with dns_a_add.php, the script runs no a record is not being added, here is the script :

    Code:
    <?php
    
    require 'soap_config.php';
    
    
    $client = new SoapClient(null, array('location' => $soap_location,
            'uri'      => $soap_uri,
            'trace' => 1,
            'exceptions' => 1));
    
    
    try {
        if($session_id = $client->login($username, $password)) {
            echo 'Logged successfull. Session ID:'.$session_id.'<br />';
        }
    
        //* Set the function parameters.
        $client_id = 1;
        $params = array(
            'server_id' => 5,
            'zone' => 'mydomain.com.',
            'name' => 'test',
            'type' => 'a',
            'data' => '192.168.0.11',
            'aux' => '0',
            'ttl' => '86400',
            'active' => 'y',
            'stamp' => 'CURRENT_TIMESTAMP',
            'serial' => '1',
        );
    
        $id = $client->dns_a_add($session_id, $client_id, $params);
    
        echo "ID: ".$id."<br>";
    
        if($client->logout($session_id)) {
            echo 'Logged out.<br />';
        }
    
    
    } catch (SoapFault $e) {
        echo $client->__getLastResponse();
        die('SOAP Error: '.$e->getMessage());
    }
    
    ?>
    
    Any help would be greatly appreciated.
     
  2. saco721

    saco721 Member

    I have found a very good script that accomplishes what I need to do, but i'm still having problems. Basically the DNS zone is being created, but the a record, ns records and mx records are still missing. The site is also being created. If I try to access the site I get :

    But if I delete the newly created client I get :

    Does this mean that the records for the zone are being created, ie, dns_rr(9)?, if so why cant I see them?
    Please see attached file for the script. Thank you very much for any help I can get.
     

    Attached Files:

Share This Page