From e432e98413226e3d2779452bcd817bcbaccdf480 Mon Sep 17 00:00:00 2001 From: Juan Font Alonso Date: Sat, 2 Oct 2021 12:12:22 +0200 Subject: [PATCH] Send hostname in toNode --- machine.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/machine.go b/machine.go index d963d35f..fa643c5c 100644 --- a/machine.go +++ b/machine.go @@ -147,7 +147,12 @@ func (h *Headscale) toNode(m Machine, includeRoutes bool) (*tailcfg.Node, error) keyExpiry = time.Time{} } - hostname := fmt.Sprintf("%s.%s.%s", m.Name, m.Namespace.Name, h.cfg.BaseDomain) + var hostname string + if h.cfg.DNSConfig.Proxied { // MagicDNS + hostname = fmt.Sprintf("%s.%s.%s", m.Name, m.Namespace.Name, h.cfg.BaseDomain) + } else { + hostname = m.Name + } n := tailcfg.Node{ ID: tailcfg.NodeID(m.ID), // this is the actual ID