Skip to content

[BUG] useLocalInstall() does not recognize common homelab/internal DNS domains such as .home #976

@williamscody

Description

@williamscody

Summary

The useLocalInstall() hook currently only treats the following hostnames as “local installs”:

* localhost
* 127.0.0.1
* ::1
* *.local
* RFC1918 private IP ranges (192.168.x.x, 10.x.x.x, 172.16-31.x.x)

This prevents self-hosted OpenHamClock instances accessed through common internal DNS/reverse proxy setups from being recognized as local installs.

As a result, features gated behind isLocalInstall (such as UDP Spots) are incorrectly disabled even though the application is running entirely on the local LAN.

Current code:

if (host === 'localhost' || host === '127.0.0.1' || host === '::1') return true;
if (host.endsWith('.local')) return true;
if (host.startsWith('10.') || host.startsWith('192.168.')) return true;

Problem

Many modern homelab/self-hosted environments use internal DNS domains such as:

  • .home
  • .lan
  • .internal
  • custom split-horizon DNS domains

For example:
https://hamclock.home
is a completely local installation behind:

  • local DNS
  • local reverse proxy
  • local TLS certificates
  • LAN-only routing

However, OpenHamClock reports "Hosted mode" and disables local-only functionality (like UDP Spots as the DX Cluster source)

Additional Issue with .local

On macOS/iOS, .local is reserved for Bonjour/mDNS and is often unreliable or inappropriate for manually-defined DNS records.

Many homelab users intentionally avoid .local for this reason and instead use:

  • .home
  • .lan
  • custom internal domains

So limiting local detection to .local creates avoidable interoperability issues.

Suggested Fix

At minimum, support additional common internal domains:

if (
  host.endsWith('.local') ||
  host.endsWith('.home') ||
  host.endsWith('.lan')
) return true;

Better Long-Term Approach

Instead of hardcoding domain suffixes, consider determining “local install” based on:

  • whether the backend is self-hosted
  • whether the frontend/backend origins match
  • whether the server is reachable on RFC1918/private addressing
  • an explicit environment variable/config option

Environment

  • OpenHamClock latest release (26.3.2)
  • Ubuntu 24.04
  • Caddy reverse proxy
  • AdGuard Home local DNS
  • macOS clients

Metadata

Metadata

Labels

bugSomething isn't working

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions