...TXT records with that name (tested: two records sharing the name, both removed). Use:
curl -sk "$(da api-url --user=USER)/CMD_API_DNS_CONTROL" \
--data-urlencode "domain=example.com" \
--data-urlencode "action=select" \
--data-urlencode...
Which can be autogenerated in CLI under root login:
da api-url --user=username
for example:
curl -k "$(da api-url --user=dbtest)/CMD_API_DNS_CONTROL?domain=dbtest.localhost&action=select&delete=yes&txtrecs[]=name=_deletetest&value=probe-1234567890"
Hi,
I would like to report a persistent bug in CMD_API_DNS_CONTROL action=delete: the API answers error=0&text=Records Deleted while the record is still in the zone. The delete never happens, in any of the parameter formats documented or mentioned in older threads.
Environment
DirectAdmin...
...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...