Skip to content

v0.2.2: Resolve PTR via configured nameservers (fix local address resolution)#3

Merged
ibehren1 merged 3 commits into
mainfrom
v0.2.2
Jun 25, 2026
Merged

v0.2.2: Resolve PTR via configured nameservers (fix local address resolution)#3
ibehren1 merged 3 commits into
mainfrom
v0.2.2

Conversation

@ibehren1

Copy link
Copy Markdown
Owner

Summary

v0.2.2 — fix local (RFC1918) addresses not resolving in real mode.

The problem

Local addresses weren't resolving on a real host even though dig -x <addr> resolved them against the same DNS server. Public addresses resolved fine.

Root cause

socket.gethostbyaddr() goes through glibc NSS → the systemd-resolved stub at 127.0.0.53, which by default does not forward reverse lookups for private (RFC1918) ranges to the upstream resolver. dig -x works because it reads /etc/resolv.conf and queries the nameservers directly, bypassing that stub. So fwtop's LAN addresses came back unresolved while public ones did not.

The fix

Resolve PTR the way dig -x does — query the nameservers in /etc/resolv.conf directly with dnspython, falling back to socket.gethostbyaddr if dnspython is unavailable. This resolves local and public addresses alike; results stay cached in-process so each address is looked up once.

  • Add dnspython>=2.4,<3 dependency; bundle dns.* in the PyInstaller spec for the frozen binaries
  • Document the resolver behavior in the README
  • Bump version to 0.2.2

Verified

  • dnspython reads the configured nameservers from /etc/resolv.conf (a private resolver in the test environment — the exact scenario this fixes)
  • Public PTRs resolve (1.1.1.1one.one.one.one, 9.9.9.9dns9.quad9.net); unresolvable addresses return the raw IP; caching works; app smoke test passes

Note: the reporter's specific address (10.1.1.92) is on their network and can't be exercised from CI, but the new path is exactly what makes dig -x succeed against their resolver.

ibehren1 added 3 commits June 25, 2026 12:26
Local (RFC1918) addresses weren't resolving on real hosts even though
'dig -x' resolved them. Cause: socket.gethostbyaddr() goes through NSS
and, on systemd-resolved hosts, the 127.0.0.53 stub doesn't forward
reverse lookups for private ranges to the upstream resolver by default.

Query the nameservers from /etc/resolv.conf directly with dnspython
(like dig -x), falling back to gethostbyaddr if dnspython is missing.
This resolves local and public addresses alike; results stay cached
in-process.

- Add dnspython dependency; bundle dns.* in the PyInstaller spec
- Document the resolver behavior in the README
- Bump version to 0.2.2
The smoke->fire legend sat directly under the last heatmap row. Pad
with blank lines so it anchors to the bottom of the tab, and center it
horizontally to the widget width (manual space prefix, since an
appended child Text's justify doesn't propagate to the parent).

Regenerate drops screenshot.
Replace the 4-char single-color swatch with the complete smoke->fire
gradient (one swatch per ramp color, 0 -> peak), so the legend maps
every color the cells can take. Regenerate drops screenshot.
@ibehren1 ibehren1 self-assigned this Jun 25, 2026
@ibehren1
ibehren1 merged commit e9cd14c into main Jun 25, 2026
@ibehren1
ibehren1 deleted the v0.2.2 branch June 25, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant