Help,

I am having difficulties adding Nameserver domains using the API provided.

Each time I get a "Unable to verify existence of nameserver" despite having called "registry_add_ns".

We are providing a custom web interface for out clients to manage their domains and want to add a function for them to change their nameservers.

The code tries to add the nameserver they entered and if it gets back the "unable to .." error calls registry_add_ns.

Unfortunately the result back has no attributes and hence the NSI response code (the .com registry) is undefined despite getting a success back for the call overall. The result on the second call to modifydomain is the same.

I am at a loss to know what to do. I've also tried using createnameserver for the domain passing the domainname and ipaddress but with no more luck - I get a permission denied error even though I've created a cookie for the domain.

It there something basic that I'm missing here?

Peter FitzPatrick


my $server = { 'name' => $nameServer, 'action' => 'add' };

  my $attributes =
  {
    'data' => 'nameserver_list',
    'nameserver_list' =>
    [
      $server
    ]
  };
  $response = $srs->sendCommand('modify','domain',$attributes,$cookie);

my $temp = $response->{'response_text'};

if (not($response->{'is_success'}) && $temp =~ '^Command failed: unable to verify existence of nameserver.')
{
$class->log("creatingNameserver $nameServer in domain $domain because of $temp");
#Try creating the nameserver object
my $nsAttributes =
{
'fqdn' => $nameServer,
'tld' => '.com',
'all' => 0
};
my $nsResponse = $srs->sendCommand('registry_add_ns','nameserver',$nsAttributes);


$class->log("DOT COM Reply $nsResponse->{'attributes'}->{'NSI'} $nsResponse->{'response_text'}");

        $nsAttributes =
    {
     'name' => $nameServer,
     'ipaddress' => $ipAddress
    };

#$nsResponse = $srs->sendCommand('create','nameserver',$nsAttributes,$cookie);


if (not($nsResponse->{'is_success'}))
{
$class->log("Create Name Server Failed: $nsResponse->{'response_text'}");
$srs = undef;
return [$nsResponse->{'response_code'},$nsResponse->{'response_text'}];
}
$response = $srs->sendCommand('modify','domain',$attributes,$cookie);
}




Reply via email to