Hallo,
I have tried to use the Import DNS Records
API methode.
My command is:
cf_data=$(curl -sX POST "${cf_api}/zones/${cf_dns_zone}/dns_records/import" \
-H "Authorization: Bearer ${cf_api_key}" \
--form 'file=@bind_config.txt' \
--form 'proxied=false')
And the bind_config.txt
has the following structure.
www.n-tp.de. 1 IN CNAME n-tp.de.
_imaps._tcp.n-tp.de. 1 IN SRV 0 0 993 n-tp.de.
_pop3s._tcp.n-tp.de. 1 IN SRV 0 0 995 n-tp.de.
_smtps._tcp.n-tp.de. 1 IN SRV 0 0 465 n-tp.de.
_acme-challenge.n-tp.de. 1 IN TXT IGJu7z2nn2cRAfWMligRxF7EIy0cn5F36Nh3xBVoanY
n-tp.de. 1 IN NS guy.ns.cloudflare.com.
n-tp.de. 1 IN NS jamie.ns.cloudflare.com.
ns1.n-tp.de. 1 IN A 185.239.238.159
_dmarc.n-tp.de. 1 IN TXT v=DMARC1; p=none
n-tp.de. 1 IN TXT v=spf1 +a +mx +a:n-tp.de -all
webmail.n-tp.de. 1 IN A 185.239.238.159
ns2.n-tp.de. 1 IN A 185.239.238.159
ftp.n-tp.de. 1 IN CNAME n-tp.de.
_domainconnect.n-tp.de. 1 IN TXT domainconnect.plesk.com/host/n-tp.de/port/8443
ipv4.n-tp.de. 1 IN A 185.239.238.159
mail.n-tp.de. 1 IN A 185.239.238.159
n-tp.de. 1 IN A 185.239.238.159
n-tp.de. 1 IN MX 10 mail.n-tp.de.
api.n-tp.de. 1 IN A 185.239.238.159
But the Api call return the following error
{
"code": 1001,
"error": "method_not_allowed"
}
It is possible without any problem to import the bind_config.txt
on the cloudflare website manually without any problem. But the API has a problem with this file.
How i can solve this problem.