certwrangler.dns module

certwrangler.dns module#

certwrangler.dns.wait_for_challenges(ctx: Context, dns_records: List[Tuple[str, str]], wait_timeout: timedelta, sleep: int = 5) None[source]#

Wait for our DNS challenges to propagate.

Parameters:
  • ctx – The click.Context of the application.

  • dns_records – A list of tuples containing the domain and the expected TXT record value.

  • wait_timeout – A datetime.timedelta of how long to wait.

  • sleep – How long to sleep between each loop.

Raises:

TimeoutError – Raised if the wait_timeout expires before we get our expected results.

certwrangler.dns.resolve_cname(ctx: Context, name: str) str[source]#

Resolves name to its canonical name by recursively following any CNAME records until we fail to get a response. This can result in name just being returned if it doesn’t resolve to a CNAME.

Parameters:
  • ctx – The click.Context of the application.

  • name – The domain name to resolve.

Returns:

The canonical name that name resolves to.

Raises:

ValueError – Raised if an infinite loop is detected in CNAME resolution.

certwrangler.dns.resolve_zone(ctx: Context, name: str) str[source]#

Climb through the domain tree until we find the SOA for the zone.

Parameters:
  • ctx – The click.Context of the application.

  • name – The domain name to resolve.

Returns:

The zone name belongs to.

Raises:

ValueError – Raised if we fail to find an SOA.