Remove NS record

websign

New member
Joined
Mar 9, 2012
Messages
3
Hello

I have record for my domain:

[domain]. NS [ns1].

domain is IDN domain (starts with xn--) if it does make any difference

I don't know how to delete this record using API (I use HTTPSocket class).

I try to execute:

Code:
$sock->query('/CMD_API_DNS_CONTROL',
   array(
      'domain' => '[domain]',
      'action' => 'select',
      'arecs0' => 'name='.'[domain].'.'&value='.'[ns1].'),
    ));

$result = $sock->fetch_body();

but it doesn't work.

A also tried it in reverse order meaning:

Code:
$sock->query('/CMD_API_DNS_CONTROL',
   array(
      'domain' => '[domain]',
      'action' => 'select',
      'arecs0' => 'name='.'[ns1].'.'&value='.'[domain].'),
    ));

$result = $sock->fetch_body();
but it also doesn't work.

Do you have any ideas how to do it using api?
 
I earlier read http://www.directadmin.com/forum/showthread.php?t=25840&page=1 and thought it could be impossible but it is very easy indeed

Code:
$sock->query('/CMD_API_DNS_CONTROL',
   array(
      'domain' => '[domain]',
      'action' => 'select',
      'delete' => 'delete'
      'nsrecs0' => 'name='.'[domain].'.'&value='.'[ns1].'),
    ));

$result = $sock->fetch_body();

Notice that you don't do any urlencode here and for ns record you use nsrecs0 not arecs0
 
Back
Top