List all domains via DirectAdmin API

dapikk

New member
Joined
Jan 7, 2014
Messages
4
Hi guys,

Firstly - I do not know if this is the right place, but I have searched many forums for quick way of listing all domains on DA servers - no go.
As I have found one and that is not included in features nor in manual - I'll post it here.

All you have to do is turn to "CMD_API_DNS_ADMIN" link here: http://www.directadmin.com/features.php?id=532 If you pass no variables with POST or GET - You get back an array list of domains. Which in my case was needed.

Code in my case (server request makes admin connection):
Code:
public function get_domains()
	{
		$this->server_request('/CMD_API_DNS_ADMIN', null, $return);
		return (!empty($return['list']) ?  $return['list'] : array()) ;
	}

To any admins - please move this post to right Forum if needed and also notify DA staff to update feature listing if possible - because many people seem to search same thing over the years but have not found it due to poor manual...

Br,
KT.
 
Try
PHP:
CMD_API_DNS_CONTROL
instead of
PHP:
CMD_API_DNS_ADMIN
, might be permissions problem as 'CMD_API_DNS_ADMIN' can be executed only from administrative user account.
 
Try
PHP:
CMD_API_DNS_CONTROL
instead of
PHP:
CMD_API_DNS_ADMIN
, might be permissions problem as 'CMD_API_DNS_ADMIN' can be executed only from administrative user account.

Thanks for your reply - As I underestand - CMD_API_DNS_CONTROL works the same.
Added link for that also: http://www.directadmin.com/features.php?id=504

(In my case there was only need for admin to access server for statistics - but thank you for pointing out more possibilities :))
 
Back
Top