I used ChatGPT to get the appropriate command necessary to create a SRV record on CloudFlare. I'm able to make other record types, however SRV is tricky because it requires multiple data keys in the --content field. I tried:
Traceback (most recent call last):
File "/opt/homebrew/bin/lexicon", line 8, in <module>
sys.exit(main())
File "/opt/homebrew/lib/python3.10/site-packages/lexicon/_private/cli.py", line 135, in main
results = client.execute()
File "/opt/homebrew/lib/python3.10/site-packages/lexicon/client.py", line 216, in execute
return executor.create_record(rtype, name, content)
File "/opt/homebrew/lib/python3.10/site-packages/lexicon/client.py", line 35, in create_record
return self.provider.create_record(rtype, name, content)
File "/opt/homebrew/lib/python3.10/site-packages/lexicon/_private/providers/cloudflare.py", line 89, in create_record
payload = self._post(f"/zones/{self.domain_id}/dns_records", data)
File "/opt/homebrew/lib/python3.10/site-packages/lexicon/interfaces.py", line 170, in _post
return self._request("POST", url, data=data, query_params=query_params)
File "/opt/homebrew/lib/python3.10/site-packages/lexicon/_private/providers/cloudflare.py", line 213, in _request
response.raise_for_status()
File "/opt/homebrew/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.cloudflare.com/client/v4/zones
When I look at pre-existing SRV records, they appear to have --content like this:
Yes SRV records are not officially supported by Lexicon. The tools is mainly here to manipulate A, CNAME and TXT records for the sake of DNS-01 challenges with Let'sEncrypt.
I used ChatGPT to get the appropriate command necessary to create a SRV record on CloudFlare. I'm able to make other record types, however SRV is tricky because it requires multiple data keys in the
--content
field. I tried:Which resulted in the following error:
When I look at pre-existing SRV records, they appear to have
--content
like this: