← Retour au blog
tech 6 May 2026

A Caddy Certificate Expired Due to a systemd-resolved Issue

When automated certificate management fails, understanding the underlying causes is crucial. Let's dive into a real-world case where a systemd-resolved failure led to a Caddy certificate expiration.

Article inspired by the original source
A Caddy Cert Expired Because systemd-resolved Was Selectively Broken ↗ rant.mvh.dev

Introduction

In today's tech ecosystem, automation is king. But what happens when something doesn't work as planned? This is what happened with a Caddy certificate expiration caused by a failure in systemd-resolved. This article explores how an incorrect DNS configuration can lead to the failure of automatic certificate renewals.

The Background

It all started on a Sunday evening when alerts flagged that the Matrix server certificate had expired. The certificate was supposed to be automatically renewed by Caddy using a Cloudflare DNS-01 challenge for Let's Encrypt certificates. However, something didn't go as planned.

Investigating the Cause

The first step was to check the Docker containers. All services were operational. The issue clearly lay with the TLS certificate renewal. Upon examining the Caddy logs, it was found that the renewal was failing due to a DNS problem.

The Root Cause: systemd-resolved

This is where systemd-resolved comes into play. This service is responsible for DNS resolution and, in this case, it was selectively failing for certain queries. This malfunction led to a SERVFAIL error on a specific DNS zone, preventing the certificate renewal.

Solution and Prevention

The solution was to reconfigure systemd-resolved to ensure all necessary DNS queries were properly resolved. This involved checking DNS configurations and ensuring the resolution path was valid. Additionally, actively monitoring certificate renewals is crucial to avoid such surprises.

Conclusion

This incident highlights the importance of understanding critical dependencies in an automated system. A faulty configuration can have significant impacts, such as interrupting the federation of Matrix servers. Teams need to be vigilant and ready to intervene quickly.

_Let's discuss your project in 15 minutes._

Caddy systemd-resolved DNS automation certificate renewal
Deepthix newsletter · 100% AI · every Monday 8am

An AI agent reads tech for you.

Our AI agent scans ~200 sources per week and ships the best articles to your inbox Monday 8am. Free. One click to unsubscribe.

Visit the newsletter page →

Want to automate your operations?

Let's talk about your project in 15 minutes.

Book a call