How to Use systemd‑resolved to Serve a Local Search Domain on My Home Network

Why a Local Search Domain Matters

In a home network you often want to reach devices by simple names—printer, raspberrypi, nas—instead of remembering IP addresses. A local search domain lets the resolver append a suffix automatically, turning printer into printer.home.local. systemd‑resolved can supply that suffix for the host itself, and, when coupled with a lightweight DNS forwarder, can expose the same domain to all clients.

Prerequisites

ItemWhy it mattersTypical command
systemd‑resolved enabledIt supplies the stub resolver on 127.0.0.53systemctl enable --now systemd-resolved
systemd‑networkd or another network managerNeeded to push the domain to clients via DHCPsystemctl enable --now systemd-networkd
Optional: dnsmasq or bindTo serve the domain to other hostsapt install dnsmasq (Debian/Ubuntu)
Firewall configuredTo restrict DNS trafficufw allow 53 (or firewalld rules)

All examples assume a Debian‑based system; adjust package names for your distro.

[Read More]

Stop the “REMOTE HOST IDENTIFICATION HAS CHANGED!” error by cleaning ~/.ssh/known_hosts.

Why the “REMOTE HOST IDENTIFICATION HAS CHANGED!” error appears

The message “REMOTE HOST IDENTIFICATION HAS CHANGED!” shows up every time you try to SSH into a host that reports a different key than the one you stored in ~/.ssh/known_hosts.
It’s a sanity check that protects you from man‑in‑the‑middle attacks, but it can also be a pain when you’re just redeploying a server or spinning up a VM that got a new IP.

[Read More]

Fix a Boot Stuck at “Loading initramfs” After Adding an NVMe to Ubuntu 24.04

When a new NVMe sticks, the boot can stall at “Loading initramfs”

Adding a second NVMe drive to an existing Ubuntu 24.04 installation is a quick way to get more storage or carve out a dedicated data partition.
Most of the time the kernel pulls the NVMe driver on its own, but a handful of mis‑configurations can make the system hang in the initramfs shell.
Typical symptoms:

  • The screen shows “Loading initramfs …” and then stops.
  • The prompt switches to a root shell (root@hostname:/#).
  • Nothing else happens until you manually exit or reboot.

Below is a hands‑on walk‑through of the most common culprits and how to fix them. I’ll assume you have a working Ubuntu 24.04 install and a spare NVMe device that you just plugged in.

[Read More]

Fixing “Host key verification failed” After Renaming a Jump Host Server

The “Host key verification failed” error after renaming a jump host

When you rename a jump host (or any SSH‑accessible machine) the client still keeps the old hostname in its ~/.ssh/known_hosts. On the next connection the client pulls the key presented by the renamed host and compares it with the stored key for the old name. The mismatch triggers the classic

Host key verification failed.

It’s a safety net against man‑in‑the‑middle attacks, but it can be a nuisance when you legitimately change the hostname. Below is a practical, step‑by‑step fix, a few automation tricks, and some security notes I’ve learned after 20 years on the grind.

[Read More]

How to Stop a systemd Timer from Failing After a Reboot Due to an Unset $USER Variable

Why the $USER Variable Matters for Systemd Timers

Systemd timers are the go‑to replacement for cron on almost every distro. They’re declarative, mesh cleanly with the unit graph, and bring a bunch of goodies—persistent timers, calendar syntax, and dependency handling. The catch? If your timer’s service unit runs a script that relies on $USER, you’ll see a silent failure after a reboot. Systemd doesn’t set $USER for system‑wide units; it only populates it for user‑specific units that run in a logged‑in session.

[Read More]

Converting a Nested JSON List of Users into a Simple CSV with jq and awk

When a service spits out a JSON blob that contains a list of users, the data is usually nested and has more fields than you actually need. Turning that into a flat CSV is a common thing to do for automation scripts, reporting, or feeding into spreadsheets. The two most reliable command‑line tools for this job are jq (a JSON processor) and awk (a text filter). Together they give you a fast, secure, and scriptable pipeline.

[Read More]

Fixing a Failed /boot Mount in Emergency Mode on Ubuntu 24.04 LTS After a Kernel Update

Why a kernel update can drop you into emergency mode because /boot won’t mount

A fresh kernel can change the initramfs or the boot‑loader’s config, and if the loader can’t find the /boot partition the system drops into that classic emergency shell:

Emergency shell (root=rw) – press Ctrl‑D to continue

Below is a no‑fluff, hands‑on walk‑through that keeps the commands you need, the trade‑offs, and a few security reminders.


1. Inspect the emergency environment

First, make sure the culprit is really the /boot mount. In the emergency shell run:

[Read More]

Stopping Bluetooth headphones from disconnecting on GNOME 48: a quick PipeWire tweak

Why Bluetooth headphones keep dropping on GNOME 48

Bluetooth audio on GNOME 48 is now handled by PipeWire instead of the old PulseAudio stack. The new stack is cleaner, but it also turns on a “low‑power” mode that can make a headset drop after a few minutes of idle time or when you close the laptop lid. The real culprit is usually the kernel’s power‑management for the Bluetooth controller and PipeWire’s default settings.

[Read More]

Using systemd‑cgtop to Spot the Service Eating All Your Memory

Quick Memory Hunt with systemd‑cgtop

When a server starts to feel sluggish, most folks jump straight to CPU or disk I/O. Memory is the silent saboteur that slips under the radar until it’s too late. On modern Linux, every service lives in a cgroup, and systemd‑cgtop gives you a live, per‑service view of how that cgroup is eating RAM. Unlike top or ps, it aggregates the numbers for you, so you can spot the offender in a glance.

[Read More]

Pinning the NVIDIA Driver on Ubuntu 24.04 to Avoid Kernel Update Breakage

Why Pinning the NVIDIA Driver Matters on Ubuntu 24.04

Kernel updates are a blessing and a curse. They bring new features, hardware support, and security patches, but they also can break proprietary modules that depend on a specific ABI. The NVIDIA driver is a prime example: a new kernel may require a new driver build, and if you’re running a GPU‑heavy workload or a GPU‑accelerated service, an unexpected reboot or a “module not found” error can be costly.

[Read More]