I created the following template in /usr/local/directadmin/data/templates/custom/dns_txt.conf
After that, when I create a new user through directadmin GUI, all the 3 records above were inserted in DNS record perfectly, but if I use API to create a new user, the last record _domainkey from the above template, did not appear in DNS text entry (only the first and second records were inserted).
So, I also put the last record dns_txt.conf alone in /usr/local/directadmin/data/templates/custom/dns_txt.conf like this:
Then when I create user using directadmin GUI, it creates the _domainkey record in DNS but using API will not create this record.
I also ran directadmin in debug mode and found no error related to this. What could be the reason?
Step to reproduce
1) Add this entry into /usr/local/directadmin/data/templates/custom/dns_txt.conf
2) Restart directadmin
3) Run rewrite_confs
4) Call API (sample):
Problem:
When using API, user will be created with domain successfully and all DNS records were created perfectly except the record for '_domainkey', but when this is done through GUI, all DNS records including _domainkey were created without problem.
Expected:
'_domainkey' record should be written in DNS record when using API as it's working fine when using GUI.
Code:
|DOMAIN|.="v=spf1 a mx ip4:|SERVER_IP||EXTRA_SPF| ~all"
_dmarc="v=DMARC1; p=none; sp=none; rua=mailto:spam-reports@|DOMAIN|"
_domainkey="o=~; r=webmaster@|DOMAIN|"
After that, when I create a new user through directadmin GUI, all the 3 records above were inserted in DNS record perfectly, but if I use API to create a new user, the last record _domainkey from the above template, did not appear in DNS text entry (only the first and second records were inserted).
So, I also put the last record dns_txt.conf alone in /usr/local/directadmin/data/templates/custom/dns_txt.conf like this:
Code:
_domainkey="o=~; r=webmaster@|DOMAIN|"
Then when I create user using directadmin GUI, it creates the _domainkey record in DNS but using API will not create this record.
I also ran directadmin in debug mode and found no error related to this. What could be the reason?
Step to reproduce
1) Add this entry into /usr/local/directadmin/data/templates/custom/dns_txt.conf
Code:
_domainkey="o=~; r=webmaster@|DOMAIN|"
2) Restart directadmin
Code:
echo "action=directadmin&value=restart" >>/usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d2000
3) Run rewrite_confs
Code:
/usr/local/directadmin/custombuild/build rewrite_confs
4) Call API (sample):
Bash:
username="$1"
email="$2"
password="$3"
domain="$4"
package_name="$5"
ip_type="$6"
command="CMD_API_ACCOUNT_RESELLER" # Same thing on CMD_ACCOUNT_RESELLER
data="username=${username}&email=${email}&passwd=${password}&passwd2=${password}&domain=${domain}&package=${package_name}¬ify=yes&ip=${ip_type}&action=create&add=yes&json=yes"
method="POST"
curl --silent --request "${method}" --user "${api_username}":"${api_password}" --data "${data}" "${ssl}://${server.domain.com}:2222/${command}"
Problem:
When using API, user will be created with domain successfully and all DNS records were created perfectly except the record for '_domainkey', but when this is done through GUI, all DNS records including _domainkey were created without problem.
Expected:
'_domainkey' record should be written in DNS record when using API as it's working fine when using GUI.
Last edited: