LibrePortal/scripts/network/dns/setup_dns_ip.sh
librelad e5f6f4c371 feat(dns): split-horizon local DNS for app subdomains
setupLocalDnsRewrites points every configured domain at the server's LAN IP
inside the self-hosted resolver, so app subdomains resolve locally and hit
Traefik directly (valid certs, no router hairpin). AdGuard gets a wildcard
rewrite per domain via its REST API; Pi-hole gets per-host A records in the
supported, mounted custom.list (no wildcard support there). Safe by
construction: idempotent, guarded by installed-checks, cannot corrupt the
resolver. Hooked into the Apply-DNS actions and resolver install. Also drops
the dead HOST_NAME read from the setupDNSIP stub.

NOTE: needs a live smoke-test — the AdGuard API call and Pi-hole reload
can't be exercised without the running containers.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-22 01:10:56 +01:00

21 lines
640 B
Bash
Executable File

#!/bin/bash
setupDNSIP()
{
local app_name="$1"
if [[ "$app_name" == "" ]]; then
isError "Something went wrong...No app name provided..."
if [[ "$initial_command2" == "terminal" ]]; then
resetToMenu;
fi
fi
# STUB: meant to resolve the reachable IP of the given resolver
# (adguard/pihole) into $dns_ip_setup for updateDNS. Not implemented yet,
# so updateDNS falls back to CFG_DNS_SERVER_* upstreams. (Previously read
# CFG_<APP>_HOST_NAME here, which is unused — removed during the per-port
# subdomain refactor so HOST_NAME has no remaining DNS dependency.)
:
}