I'm trying to run the certbot challenge on a pi that I've been using with let's encrypt for a little over a year. I just recently installed pihole, so I am guessing that is why I am getting the error run below when running the certbot challenge (I'm a total noob, so, well, guessing). I tried disabling pihole with pihole disable , but it appears that that just disables ad-blocking, not the dns server itself. Is there a way to temporarily switch back to using my router's default as the dns server for my pi just while I run the challenge?
Expected Behaviour:
Pass certbot challenge
Actual Behaviour:
"Cleaning up challenges
Problem binding to port 80: Could not bind to IPv4 or IPv6."
If you want to briefly enable port 80 for the certbot challenge, then you can stop the lighttpd server that is holding that port. Try sudo systemctl stop lighttpd.service or if that does not work, try sudo service lighttpd stop.
Guessing you're using Let's Encrypt for a web cert. They expire every three months so you will have to go through this four times a year. Might want to cron job it to enable port 80, then renew your cert, then restart lighttpd. Also good to script it to email you with success or failure.
$ cat /etc/cron.d/certbot
# /etc/cron.d/certbot: crontab entries for the certbot package
#
# Upstream recommends attempting renewal twice a day
#
# Eventually, this will be an opportunity to validate certificates
# haven't been revoked, etc. Renewal will only occur if expiration
# is within 30 days.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(3600))' && certbot -q renew
Could alter that last line into:
0 */12 * * * root service lighttpd stop && test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(3600))' && certbot -q renew || service lighttpd start
0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(3600))' && service lighttpd stop && certbot -q renew; service lighttpd start
But have to keep in mind that if the certbot package gets updated, the crontab could be defaulted again!
EDIT: I altered the crontab a bit as you dont want lighttpd to be down the whole "sleep int(rand(3600))" period.