Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot make SRV on CloudFlare #1861

Open
ProfessorManhattan opened this issue Jan 13, 2024 · 1 comment
Open

Cannot make SRV on CloudFlare #1861

ProfessorManhattan opened this issue Jan 13, 2024 · 1 comment

Comments

@ProfessorManhattan
Copy link

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:

lexicon cloudflare create example.com SRV --name "_sip._tcp" --content "1 5 5060 sip.example.com"

Which resulted in the following error:

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:

0\t2380\tmercury.example.com
@adferrand
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants