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

Can't use lexicon with pending Cloudflare domains #1659

Closed
vjagaro opened this issue Jul 24, 2023 · 0 comments · Fixed by #1660
Closed

Can't use lexicon with pending Cloudflare domains #1659

vjagaro opened this issue Jul 24, 2023 · 0 comments · Fixed by #1660

Comments

@vjagaro
Copy link
Contributor

vjagaro commented Jul 24, 2023

I cannot use Lexicon with a domain that is pending (not active) in Cloudflare. It's useful to to be able to manipulate DNS records for pending domains before changing nameservers to minimize disruption.

Context

  1. Add a domain (e.g., example.com) in Cloudflare.
  2. Do not change the nameservers for example.com to point to Cloudflare so that it remains with a pending status.
  3. Add an API token in Cloudflare with Zone.DNS Edit and Zone.Zone Read permissions.

Example

$ lexicon --version
lexicon 3.12.0
$ lexicon cloudflare --auth-token abc...XYZ list example.com A
Traceback (most recent call last):
  File "/home/user/.local/bin/lexicon", line 8, in <module>
    sys.exit(main())
  File "/home/user/.local/pipx/venvs/dns-lexicon/lib/python3.9/site-packages/lexicon/cli.py", line 132, in main
    results = client.execute()
  File "/home/user/.local/pipx/venvs/dns-lexicon/lib/python3.9/site-packages/lexicon/client.py", line 81, in execute
    self.provider.authenticate()
  File "/home/user/.local/pipx/venvs/dns-lexicon/lib/python3.9/site-packages/lexicon/providers/base.py", line 73, in authenticate
    self._authenticate()
  File "/home/user/.local/pipx/venvs/dns-lexicon/lib/python3.9/site-packages/lexicon/providers/cloudflare.py", line 51, in _authenticate
    raise AuthenticationError("No domain found")
lexicon.exceptions.AuthenticationError: No domain found
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

Successfully merging a pull request may close this issue.

1 participant