Skip to content

Cannot make SRV on CloudFlare #1861

Description

@ProfessorManhattan

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions