Skip to content

Instantly share code, notes, and snippets.

@Hiweus
Created February 4, 2025 02:26
Show Gist options
  • Save Hiweus/5c6163c45701c048d27a0adb9b136c8b to your computer and use it in GitHub Desktop.
Save Hiweus/5c6163c45701c048d27a0adb9b136c8b to your computer and use it in GitHub Desktop.
Issue lets encrypt certificate using dns challenge

Installing dependencies

sudo apt install certbot -y

# Download and install dns plugin for certbot
# Run as root
mkdir -p /tmp/certificate && cd /tmp/certificate
wget https://github.com/joohoi/acme-dns-certbot-joohoi/raw/master/acme-dns-auth.py
# Replace python to python3 executable
cat acme-dns-auth.py | sed 's/env python/env python3/' > /etc/letsencrypt/acme-dns-auth.py
sudo chmod +x /etc/letsencrypt/acme-dns-auth.py


# Run certbot
sudo certbot certonly --manual --manual-auth-hook /etc/letsencrypt/acme-dns-auth.py --preferred-challenges dns --debug-challenges -d \*.your-domain -d your-domain


# Renew certificates
sudo certbot renew --dry-run
@Hiweus
Copy link
Author

Hiweus commented Feb 4, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment