docs/content/dns/_index.md
{{% notice important %}} lego is an independent, free, and open-source project, if you value it, consider supporting it! ❤️
This project is not owned by a company. I'm not an employee of a company.
I don't have gifted domains/accounts from DNS companies.
I've been maintaining it for about 10 years. {{% /notice %}}
Credentials and DNS configuration for DNS providers must be passed through environment variables.
The environment variables can reference a value.
Here is an example bash command using the Cloudflare DNS provider:
$ [email protected] \
CLOUDFLARE_API_KEY=b9841238feb177a84330febba8a83208921177bffe733 \
lego --dns cloudflare --domains www.example.com --email [email protected] run
The environment variables can reference a path to file.
In this case the name of environment variable must be suffixed by _FILE.
{{% notice note %}} The file must contain only the value. {{% /notice %}}
Here is an example bash command using the CloudFlare DNS provider:
$ cat /the/path/to/my/key
b9841238feb177a84330febba8a83208921177bffe733
$ cat /the/path/to/my/email
[email protected]
$ CLOUDFLARE_EMAIL_FILE=/the/path/to/my/email \
CLOUDFLARE_API_KEY_FILE=/the/path/to/my/key \
lego --dns cloudflare --domains www.example.com --email [email protected] run
{{% tableofdnsproviders %}}