...instead of using the admin user login for example.
This seems to work with the following actions allowed:
CMD_API_DNS_ADMIN
CMD_API_DNS_CONTROL
CMD_API_DNS_MX
CMD_API_DNS_RESELLER
CMD_API_LOGIN_TEST
CMD_DNS_ADMIN
CMD_DNS_CONTROL
CMD_DNS_MX
CMD_DNS_RESELLER
CMD_LOGIN
Can we limit that...
@kristian thanks, I probably only need this line, but thanks!
RESULT="$(curl -sS -u "${DA_USERNAME}:${DA_PASSWORD}" "${DA_URL}/CMD_API_DNS_CONTROL?action=edit&domain=${DOMAINNAME}&arecs0=name%3D${DNS_HOST}.%26value%3D${CONFIGURED_IP}&type=A&name=${DNS_HOST}.&value=${CURRENT_IP}&json=yes")"...
...password for the account owning DOMAINNAME. Note that the
# password here should ideally be a Login Key that only has access to
# CMD_API_DNS_CONTROL and nothing else.
DA_USERNAME="username"
DA_PASSWORD="secret"
# Configuration end...
When using CMD_API_DNS_CONTROL you must choose correct authentication because only specific user can use this whereas if you use CMD_API_DNS_ADMIN, it can be used by admin to control all domains (best to use this if authentication is admin). So, I think the main problem there was the...
...can I find any documentation about this?
The current custom feature set:
cat /usr/local/directadmin/data/templates/custom/feature_sets/domain_only/commands.allow
CMD_DNS_CONTROL
CMD_API_DNS_CONTROL
CMD_DOMAIN
CMD_API_DOMAIN
CMD_SHOW_DOMAINS
CMD_API_SHOW_DOMAINS
CMD_SUBDOMAINS
CMD_API_SUBDOMAINS
...way to get DKIM value for a specific domain via API through curl in bash? Doesn't seems to have much documentation about this CMD_API_DNS_CONTROL: https://www.directadmin.com/features.php?id=626
Currently I use this method it works but I think this is too complex. I'm not sure if there is a...
...to the link and ctrl+f and search for cmd_api_dns
I get 8 things. Not sure if that's where you looked.
I bet a lot has changed over the last several years.
Here are all the old posts as well.
https://forum.directadmin.com/search/186228/?q=cmd_api_dns_control&o=date
Welcome to the forum BTW..
Tl;dr: What has changed in the last couple months when it comes to using CMD_API_DNS_CONTROL to delete records?
The delete code suddenly needs some modifications to work again, no error about what went wrong.
The longer version:
A couple of years ago I wrote a PHP script that, when called...
Hello,
I am trying to remove all existing MX records from a domain and add my own MX-record(s).
I am using the following library to communicate with the API: https://github.com/omines/directadmin
Because this library doesn't include DNS management, I am using the "invokeApiPost" command under...
...$sock->set_method('POST');
// Set TTL to 60 seconds
$sock->query("/CMD_API_DNS_CONTROL?domain=".$DOMAIN."&action=ttl&ttl_select=custom&ttl=60");
if (!strstr($sock->fetch_body(),"error=0")) $ERROR=1;
// Remove old A record...
...Array
(
[domain] => abecadlozmien.pl
[action] => select
[select0] => name=mydomain.com.&value=40%20mxrecordtest
)
to CMD_API_DNS_CONTROL the record is not deleted, another record is deleted (from what I noticed it is a record one above)
The same problem i have with...
...Why do you send data "package=unlimited" ? It's not needed here, try:# Add
curl --request GET --user $user:$password $server/CMD_API_DNS_CONTROL?domain=$domain&action=add&type=A&name=$subdomain&value=8.8.8.8
echo $?
For deleting you should URL-encode name=www&value=1.2.3.4 so it will be...