Debugging flaky DNS on a Raspberry Pi bridge setup with nftables rules

Flaky DNS on a Raspberry Pi Bridge – A Quick Debug Guide

Running a Pi as a network bridge can feel like a walk‑through of a maze. The bridge interface (br0) sits right between your LAN and the Pi’s Wi‑Fi or Ethernet, and if DNS starts to act up, it’s usually the bridge’s handling of UDP or some nftables rule that’s tripping up. Below is a no‑frills, coffee‑talk style walk‑through to isolate and patch the problem while keeping the bridge tight.

[Read More]

Nftables log‑filter tricks to find hidden routing loops on a bridged LAN

Bridged LANs, Routing Loops, and Nftables Log‑Filtering

Bridged LANs are everywhere—from a tiny home lab to a mid‑size office. When a bridge gets a wrong port or a VLAN slips through, packets can start circling forever. The symptoms are subtle: a CPU spike on the bridge, packet loss, and a traffic burst that looks like a DoS. The problem is that the packets never hit a firewall rule that drops them—they just bounce, so you’re left staring at a wall of traffic with no obvious culprit.

[Read More]

When /etc/hosts Won’t Resolve: A Quick Systemd‑Resolved Fix

The Symptom

You’re pinging localhost or a custom hostname you added to /etc/hosts and the request hangs or returns “Name or service not known”. The same name resolves fine on another machine, and dig or nslookup against a public DNS server works. The problem is isolated to the local resolver. In most modern distributions this points to a mis‑configured systemd‑resolved service or a stale cache.

Why systemd‑resolved Matters

systemd‑resolved is the default name‑resolution daemon on Fedora, Debian, Ubuntu, Arch, and many other distros since 2015. It replaces the older dnsmasq‑based /etc/resolv.conf approach and offers:

[Read More]

Fixing systemd-resolved Ignoring /etc/hosts

Resolving local hostname lookups that fail silently

Ever had a host you added to /etc/hosts just stop answering? I’ve seen this happen after a kernel upgrade or a quick edit that left a stray comment. On Fedora, Debian, and Arch the culprit is almost always the local resolver: systemd‑resolved. It only reads /etc/hosts if the ResolveFile option is enabled and the service is started with --resolve. A tiny mis‑config can silence that hook.


1. Check that systemd‑resolved is actually running

systemctl status systemd-resolved.service

If you see inactive or failed, start it up:

[Read More]

Fixing systemd-resolved Dropping /etc/hosts Entries

When a local service becomes unreachable

systemd‑resolved is the default DNS resolver on most modern distros. It pulls /etc/hosts unless you flip the --no-hosts flag. In 2026 a subtle tweak in its default behaviour started swallowing local hostname lookups, and no one noticed until a service went down.

Why it happens

systemd-resolved now gives the DNS stack a higher priority than the hosts file when you call getaddrinfo(3). If a name shows up in both /etc/hosts and a DNS zone, the DNS answer wins. When the zone is empty or the query times out, it silently falls back to the hosts file. But if the DNS server is unreachable and the hosts entry points to 127.0.0.1 or ::1, the resolver drops that entry and returns ENOTFOUND. The change was meant to stop a compromised DNS server from poisoning local lookups.

[Read More]

When ss Shows No Open TCP Ports Even Though Services Are Running

Why ss Might Show No Open TCP Ports Even When Services Are Running

I’ve seen this happen on fresh installs, on servers that have just rebooted, and even on production machines that have been up for months. The symptom is simple: ss -tuln prints nothing, but systemctl status nginx (or whatever daemon you’re checking) says active (running). The mismatch usually boils down to one of three things:

  1. The service is listening on a non‑TCP socket
  2. The service is bound to a Unix domain socket or a local‑only address
  3. The socket is managed by a socket‑activated unit that isn’t yet in use

Below is a quick checklist that will help you zero in on the culprit, plus a few hardening tips that come with each case.

[Read More]

Debugging nftables Dropping HTTP Traffic

A step-by-step port-filter investigation

HTTP is the backbone of most web services. When a client can’t reach a web server, the first instinct is to look at the application logs, DNS, or the network path. A silent drop by nftables is a common, yet often overlooked, culprit. This post walks through a systematic approach to uncovering why nftables is silently discarding HTTP packets, with a focus on the port‑filtering rules that most administrators set up for hardening.

[Read More]

Fixing systemd-resolved Returning 127.0.0.1

Correcting search domain order on Ubuntu 24.04

Why systemd‑resolved is giving you 127.0.0.1 for every host

Ubuntu 24.04 ships with systemd‑resolved as the DNS resolver.
If every hostname you look up ends up at 127.0.0.1, the most common culprit is the search‑domain order that resolved builds.
It pulls the list from three places:

  1. /etc/resolv.conf (or the DNS=/Domains= directives in /etc/systemd/resolved.conf)
  2. DHCP‑provided domains
  3. The machine’s own hostname ($HOSTNAME)

When localhost or the local hostname lands at the top, the resolver will try it before forwarding the query to the real DNS servers, and you’ll get a loopback address for any name that isn’t fully qualified.

[Read More]

Tracking Network Flaps After a Kernel Upgrade

Finding eth0 carrier-lost messages with journalctl

When a kernel upgrade silently breaks your network

Kernel upgrades are usually painless, but on a few systems they can trigger a cascade of “carrier lost” messages that make the interface drop and come back up repeatedly. The messages are buried deep in the system journal, so you may not notice them until the network flaps start causing outages. This post shows how to locate those hidden messages with journalctl, correlate them with real‑world symptoms, and apply a fix that keeps the interface stable.

[Read More]

Fixing /etc/hosts After a Windows Sync

Removing stray CR characters from host entries

When a Windows machine syncs a shared folder that contains /etc/hosts, the file often ends up with Windows‑style CRLF line endings.

If you’ve ever pulled a hosts file from a Windows share, you’ve probably noticed that the resolver starts acting weird. The glibc resolver stops at the carriage return (\r) and treats the rest of the line as part of the hostname. That means lookups for localhost, myserver, or any entry that follows a stray CR fail, and some services silently fall back to DNS—exposing the system to name‑resolution attacks.

[Read More]