bartgrefte
Verified User
- Joined
- Jul 25, 2018
- Messages
- 3
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, either creates or deletes a TXT record using CMD_API_DNS_CONTROL. This script is being used by certbot-auto to do a DNS validation in order to obtain a Let's Encrypt wildcard certificate.
Recently the DNS validation kept failing because old TXT records were no longer deleted, adding still works just fine with the same code.
This turned out to be caused by two things:
- The contents of the variable containing the value of the record suddenly must be between " "
- The name of the TXT record used in the adding code is "_acme-challenge.ravenslair.nl", this name was also used in the delete code. Now this suddenly had to be stripped down to "_acme-challenge", in the delete code that is, it's still "_acme-challenge.ravenslair.nl" in the adding code.
And to make things confusing, I kept getting: Array ( [error] => 0 [text] => Records Deleted [details] => )
No error what went wrong, not even something like "record not found".
Now I'm curious if and what might have changed in this API that could have caused this and why I couldn't find anything in DirectAdmin's changelog, though I could have overlooked it. The lack of an error reported either by the API or in the error log found in DirectAdmin didn't make things easier...
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, either creates or deletes a TXT record using CMD_API_DNS_CONTROL. This script is being used by certbot-auto to do a DNS validation in order to obtain a Let's Encrypt wildcard certificate.
Recently the DNS validation kept failing because old TXT records were no longer deleted, adding still works just fine with the same code.
This turned out to be caused by two things:
- The contents of the variable containing the value of the record suddenly must be between " "
- The name of the TXT record used in the adding code is "_acme-challenge.ravenslair.nl", this name was also used in the delete code. Now this suddenly had to be stripped down to "_acme-challenge", in the delete code that is, it's still "_acme-challenge.ravenslair.nl" in the adding code.
And to make things confusing, I kept getting: Array ( [error] => 0 [text] => Records Deleted [details] => )
No error what went wrong, not even something like "record not found".
Now I'm curious if and what might have changed in this API that could have caused this and why I couldn't find anything in DirectAdmin's changelog, though I could have overlooked it. The lack of an error reported either by the API or in the error log found in DirectAdmin didn't make things easier...