Use *.internal.trails.cool wildcard for internal services

Add wildcard DNS record for *.internal.trails.cool (A + AAAA) so
internal services don't leak hostnames in individual DNS entries.
Move Grafana from grafana.trails.cool to grafana.internal.trails.cool.

Future internal services just need a Caddy block — no DNS changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-03-27 13:16:40 +01:00
parent bff9ff04a4
commit 559f53d8fc
No known key found for this signature in database
GPG key ID: A32FF691A0F752D9
3 changed files with 21 additions and 2 deletions

View file

@ -122,6 +122,25 @@ resource "hcloud_zone_rrset" "planner_aaaa" {
records = [{ value = hcloud_server.trails.ipv6_address }]
}
# Internal wildcard all *.internal.trails.cool resolves to the server.
# Caddy handles routing per-subdomain. No individual DNS entries needed
# for internal services (Grafana, Prometheus, etc.)
resource "hcloud_zone_rrset" "internal_wildcard_a" {
zone = "trails.cool"
name = "*.internal"
type = "A"
ttl = 300
records = [{ value = hcloud_server.trails.ipv4_address }]
}
resource "hcloud_zone_rrset" "internal_wildcard_aaaa" {
zone = "trails.cool"
name = "*.internal"
type = "AAAA"
ttl = 300
records = [{ value = hcloud_server.trails.ipv6_address }]
}
resource "hcloud_zone_rrset" "www_cname" {
zone = "trails.cool"
name = "www"