Skip to content

Global dns option discrepancy between docs and behaviour #7294

@rightaditya

Description

@rightaditya

Issue Details

The docs say the following:

Configures a default DNS provider to use when none other is specified locally in a relevant context. For example, if the ACME DNS challenge is enabled but does not have a DNS provider configured, this global default will be used. It is also applied for publishing Encrypted ClientHello (ECH) configs.

To me, this implies that if a DNS provider is set for the ACME DNS challenge, including globally via acme_dns, then that value will be used rather than the "default" one provided by the global dns setting. It seems like the hierarchy should be local dns > global acme_dns > global dns, because the global dns option also affects the ECH DNS provider.

So to me it's counterintuitive that caddy's actual behaviour is for the global dns value to override an acme_dns value. I would've submitted a PR to fix this but it's unclear which is the desired behaviour, because comments in the code make it seem like this is the correct behaviour.

This isn't a huge deal, but I could imagine that if a third option were added that also had a DNS provider setting, it'd be useful for the global dns option to be the default that could be overridden by just one of the other settings, hence the hierarchy I assumed.

If the current behaviour is indeed intended, though, a note in the docs might be helpful :)

Assistance Disclosure

AI not used

If AI was used, describe the extent to which it was used.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussion 💬The right solution needs to be founddocumentation 📚Improvements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions