Taming systemd-resolved: Avoiding DNS Surprises on Multi-Network Linux Setups

Introduction to systemd-resolved

I’ve seen systemd-resolved cause some headaches in multi-network setups, so it’s worth understanding how it works. As part of the systemd suite, systemd-resolved is a DNS resolver that’s enabled by default on many modern Linux distributions, including Ubuntu and Fedora. The real trick is configuring it to avoid DNS surprises.

Configuring systemd-resolved

To get systemd-resolved working the way you want, you need to know how it uses DNS servers. It combines the DNS servers provided by your system’s network configuration with those specified in the /etc/systemd/resolved.conf file. Don’t bother with the network configuration; just modify the resolved.conf file to specify your preferred DNS servers. For example, to use Google’s public DNS servers, add the following lines to the [Resolve] section:

[Read More]

Taming Log Noise with jq and systemd Journal Filters

Introduction to Log Noise

I’ve seen log noise become a significant headache for Linux administrators, making it tough to identify important events and errors in system logs. With the sheer volume of data generated by modern systems, filtering out irrelevant information is crucial for efficient troubleshooting and maintenance. In this article, I’ll show you how to tame log noise using jq and systemd journal filters.

Understanding systemd Journal

The systemd journal is a centralized logging solution that collects and stores log messages from various system components. It’s a robust and efficient way to manage logs, allowing administrators to filter, prioritize, and analyze log data. The journal stores log messages in a binary format, which can be queried and filtered using the journalctl command. Don’t bother with trying to parse the binary format directly - it’s not worth the hassle.

[Read More]

Using resolvectl to Diagnose and Resolve Stubborn DNS Issues on Linux

Introduction to resolvectl

I’ve seen my fair share of DNS issues on Linux, and one tool that’s always helped me resolve them is resolvectl. This command-line utility, part of the systemd suite, provides a comprehensive way to query and configure DNS settings on your system. In this article, I’ll share some practical examples of how to use resolvectl to diagnose and fix stubborn DNS issues.

Understanding DNS Resolution

Before diving into resolvectl, it’s essential to understand how DNS resolution works on Linux. The DNS (Domain Name System) is responsible for translating human-readable domain names into IP addresses that computers can understand. On Linux systems, DNS resolution is typically handled by a resolver, which queries DNS servers to resolve domain names. The resolver configuration is usually defined in /etc/resolv.conf, but with systemd, resolvectl offers a more integrated and dynamic way to manage DNS settings.

[Read More]

Taming Systemd Service Restart Policies to Prevent Cascading Failures

Introduction to Systemd Service Restart Policies

Systemd is the backbone of most modern Linux distributions, and one of its key features is managing service restart policies. I’ve seen this go wrong when a service fails and takes down the entire system with it. In this article, we’ll dive into the world of systemd service restart policies and explore how to configure them to prevent cascading failures.

Understanding Systemd Service Restart Policies

Systemd provides several restart policies that can be applied to services. The real trick is understanding when to use each one:

[Read More]

Taming Log Noise with jq and systemd Journal Filters

Introduction to Log Noise

I’ve seen this go wrong when dealing with system logs - the sheer amount of unnecessary or redundant log messages can make it difficult to identify real issues. As a Linux administrator, managing log noise is essential for efficient system maintenance and troubleshooting. In this article, I’ll share how to tame log noise using jq and systemd journal filters.

Understanding systemd Journal

Systemd journal is a powerful centralized logging system that collects and stores log messages from various system components. It provides a robust and flexible way to manage logs, including filtering, prioritization, and storage. The real trick is to leverage the journalctl command to work with systemd journal.

[Read More]

Taming log Noise with journalctl: Filtering Out the Chaff to Find Meaningful Errors

Introduction to Journalctl

I’ve been working with Linux systems for years, and one tool that’s become essential to my workflow is journalctl. As of 2026, most modern Linux distributions have adopted systemd as their default init system, making journalctl a must-know tool for system administrators and users alike. In this article, I’ll share how to use journalctl to filter out unnecessary log noise and focus on meaningful errors.

Understanding Journalctl Basics

Before diving into advanced filtering techniques, let’s cover the basics of journalctl. The command journalctl can be used to view system logs, and by default, it will show you the most recent log entries. You can use the -n option to specify the number of log entries to display, for example, journalctl -n 10 will show you the last 10 log entries. Don’t bother with sudo unless you need to access system logs - journalctl will automatically use your current user’s permissions.

[Read More]

Debugging Connectivity Issues with resolvectl and ss: A Step-by-Step Guide to Identifying DNS and Routing Problems

Introduction to Debugging Connectivity Issues

I’ve seen this go wrong when dealing with connectivity issues on Linux systems: not knowing where to start. Two essential tools can save you a lot of time - resolvectl and ss. These tools help in identifying and troubleshooting DNS and routing problems. Let’s dive into a step-by-step guide on how to use them, focusing on practical examples and security considerations where relevant.

Understanding resolvectl

resolvectl is a command-line utility provided by systemd for querying and configuring the DNS resolver. It’s incredibly useful for controlling the DNS resolver, including setting DNS servers, querying the DNS cache, and configuring DNS over TLS (DoT) or DNS over HTTPS (DoH). To get started with resolvectl, you can use the following command to status the current DNS configuration:

[Read More]

Taming systemd Service Restart Policies to Prevent Unexpected Downtime

Introduction to systemd Service Restart Policies

I’ve seen many Linux systems go down due to poorly configured service restart policies. Systemd, being the core component of most modern Linux distributions, provides a robust way to manage system services, including their startup, runtime, and shutdown. One of the key features of systemd is its ability to manage service restart policies, which dictate how services should be handled in case of failures or crashes.

[Read More]

Taming Log Noise with journalctl: Filtering Out the Usual Suspects to Find Real Issues

Introduction to Log Noise

I’ve seen log noise become a significant issue for Linux administrators, making it tough to identify real problems in system logs. With the sheer amount of data generated by various system components, it’s easy to get lost. To tackle this, I usually start with journalctl, a powerful command-line utility that allows you to view and manage system logs. It’s part of the systemd suite and provides a flexible way to filter, prioritize, and analyze log messages.

[Read More]

Resolving DNS Quirks with systemd-resolved and Split DNSConfigs

Introduction to DNS Quirks and systemd-resolved

I’ve seen my fair share of DNS issues over the years, and in complex network environments, they can become a real headache. These problems often stem from misconfigured DNS servers, conflicting resolver settings, or the challenges of managing split DNS configurations. With systemd-resolved, managing DNS resolution has become more robust and secure. I’ve found it to be an essential tool in my Linux toolkit.

[Read More]