diff --git a/server.go b/server.go index fc6650cf..440b3348 100644 --- a/server.go +++ b/server.go @@ -49,9 +49,12 @@ func Register(instance, service, domain string, port int, text []string, ifaces } } - if !strings.HasSuffix(trimDot(entry.HostName), entry.Domain) { + if !strings.HasSuffix(trimDot(entry.HostName), trimDot(entry.Domain)) { entry.HostName = fmt.Sprintf("%s.%s.", trimDot(entry.HostName), trimDot(entry.Domain)) } + if !strings.HasSuffix(entry.HostName, ".") { + entry.HostName = fmt.Sprintf("%s.", entry.HostName) + } if len(ifaces) == 0 { ifaces = listMulticastInterfaces()