tgv

Member
May 29, 2008
12
0
51
Hello,

I'm in the process of writing a plugin for dnsadmin, and I'm having trouble in making sense of the documentation.

In particular, how can I test the remote module? the "example calls" return command not found as there's no such file (tried in dnsonly and regular servers).

Perhaps it's something right under my nose but I can't see it. Would appreciate some help here.

1686031760309.png
 
Last edited by a moderator:

quietFinn

Well-Known Member
Feb 4, 2006
2,109
580
493
Finland
cPanel Access Level
Root Administrator
Did you use the full path:
/usr/local/cpanel/whostmgr/bin/dnsadmin
 
  • Like
Reactions: cPRex

tgv

Member
May 29, 2008
12
0
51
Cool, thanks. It really was under my nose.

But starting to doubt if it's very useful for testing.. and it's a binary
 

rbairwell

Well-Known Member
May 28, 2022
129
59
28
Mansfield, Nottingham, UK
cPanel Access Level
Root Administrator
Here's some notes from a ticket I raised in April about the DNSAdmin documentation under ticket 95048929 (as I'm doing a similar thing to you):
* There are two undocumented DNSAdmin routines "synckeys" and "revokekeys" relating to DNSSC - only currently used in the Cpanel::NameServer::Remote::cPanel module - custom dnsadmin plugins are checked with Perl's "can" to see if it supports these (or any other routine) before attempting to call. There is some documentation on the DNSSec Cluster Keys but I haven't study it yet.
* The example given for "addzoneconf" is the incorrect (it is the example for the cleandns routine). It is correctly documented on the old documentation site
* As you've noted, the documentation makes multiple references to the "dnsadmin" command line tool but fails to note its location (it is not in the default path for the root user). The script is at /usr/local/cpanel/whostmgr/bin/dnsadmin
* DNSAdmin does NOT support IPv6 connections. If your remote server is only IPv6, it will not be able to connect - and if it's dual hosted (as in my case), it's "luck" whether you get IPv4 or the "Bad arg length for Socket::unpack_sockaddr_in, length is 28, should be 16" error. I have got code to forcibly fetch the IPv4 address and pass that in if it helps.
(from ticket 95049765)
* If your DNSAdmin module receives a "zoneexists" calls and responds with 1 (to indicate the zone exists), the dnsadmin binary will then instantly terminate your module (ticket 95057949)

Let me know if I can be any assistance!
 

tgv

Member
May 29, 2008
12
0
51
Thanks mate, that's some priceless information.

Yeah it looks this manual was written by aliens (for predators). Reverse engineering the three existing modules plus the stackpath one from github helps way more than said manual. Also I didn't speak Perl in ages, so it takes a bit of RTFMing... Anyway, I'm halfway through writing a DigitalOcean plugin to make use of their free dns hosting. Very odd that no one did that before.

Yes ZONEEXISTS throws some warnings - but it does it on vanilla setup as well (with its own dnsonly module) and also I plan to use mine in one-way sync mode (push changes to the API) so half of the methods including this one won't be called.

To be fair the location of dnsadmin is mentioned there, I just didn't pay attention:
1686281597261.png
 

rbairwell

Well-Known Member
May 28, 2022
129
59
28
Mansfield, Nottingham, UK
cPanel Access Level
Root Administrator
To be fair the location of dnsadmin is mentioned there, I just didn't pay attention:
The fact that the page's http headers contain:

Code:
date: Fri, 09 Jun 2023 14:16:58 GMT
last-modified: Thu, 08 Jun 2023 17:54:57 GMT
and the details for addzoneconf have changed makes me think that you DIDN'T miss anything at the time... Even though the top of the web page does say "Last updated 1 month ago" (with a time datetime of 2023-05-01T22:50:31.000Z )