From b8cde30581a583a7a0c3a900c7f0ab2c95ce5f50 Mon Sep 17 00:00:00 2001 From: "Arthur K." Date: Sat, 17 Jan 2026 18:41:36 +0300 Subject: [PATCH] fix: use proper addresses on dns nodes --- internal/roles/dns/dns.go | 4 ++-- internal/roles/host/host.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/roles/dns/dns.go b/internal/roles/dns/dns.go index ffe3a66..66efb45 100644 --- a/internal/roles/dns/dns.go +++ b/internal/roles/dns/dns.go @@ -48,10 +48,10 @@ func parseState(state types.HostState) (string, []byte) { var builder strings.Builder for _, d := range state.Domains { - builder.WriteString(fmt.Sprintf("%s %s\n", state.Name, d)) + builder.WriteString(fmt.Sprintf("%s %s\n", state.Endpoint, d)) } - return hostsDir + state.Endpoint, []byte(builder.String()) + return hostsDir + state.Name, []byte(builder.String()) } func (r *Role) OnStartup(ctx context.Context) error { diff --git a/internal/roles/host/host.go b/internal/roles/host/host.go index e67c2bf..6bdea06 100644 --- a/internal/roles/host/host.go +++ b/internal/roles/host/host.go @@ -28,7 +28,7 @@ type Role struct { func New(state *state.RuntimeState, config config.HostConfig) *Role { return &Role{ - client: newClient(config.Domain, config.IpAddress), + client: newClient(config.Domain, config.LocalAddress), state: state, config: config, } @@ -87,7 +87,7 @@ func (r *Role) onCallback(w http.ResponseWriter, req *http.Request) { func (r *Role) getInternal() (types.HostState, error) { return types.HostState{ Domains: r.internalDomains, - Endpoint: r.state.Self.Address, + Endpoint: r.config.IpAddress, Name: r.state.Self.Name, }, nil }