From 71c466253c11f86cc2f2b937a9b9fa96603c9316 Mon Sep 17 00:00:00 2001 From: Martin Garton Date: Sun, 3 Jul 2016 09:20:20 +0100 Subject: [PATCH] Fix domain lookup in some cases --- zone.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zone.go b/zone.go index 1ef04d1..c947327 100644 --- a/zone.go +++ b/zone.go @@ -95,13 +95,13 @@ func NewMDNSService(instance, service, domain, hostName string, port int, ips [] if len(ips) == 0 { var err error - ips, err = net.LookupIP(hostName) + ips, err = net.LookupIP(trimDot(hostName)) if err != nil { // Try appending the host domain suffix and lookup again // (required for Linux-based hosts) tmpHostName := fmt.Sprintf("%s%s", hostName, domain) - ips, err = net.LookupIP(tmpHostName) + ips, err = net.LookupIP(trimDot(tmpHostName)) if err != nil { return nil, fmt.Errorf("could not determine host IP addresses for %s", hostName)