Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In Unifi Network, the upstream DNS resolver can be configured. This can be done in Settings > Internet under IPv4 Configuration.
In some cases, such as an environment with Microsoft Active Directory (AD) for a domain example.com, there may be a need to change the upstream DNS resolver to point to a DNS server within the internal network (i.e. the AD's DNS server) to handle all DNS queries for example.com.
When this is done, any certificate requests for the example.com domain and subdomains will fail to complete the initial local verification step because the upstream DNS server (i.e. AD server) is the authoritative name server for example.com and will not see the DNS changes applied to the external DNS provider, so it returns NXDOMAIN to LEGO.
To address the above issue, this commit adds a DNS_RESOLVER environment variable that is passed into the LEGO client in the
--dns.resolvers
flag to specific a different upstream DNS resolver to verify the new DNS entry locally. The default was chosen to be the loopback, as this was the one seen when LEGO was invoked by the script before these changes:These changes were verified on a UDM SE running Unifi OS v3.2.7 and Network 8.0.24.