From af0f516a46f7af0e1d97752dc32e2b23ce850184 Mon Sep 17 00:00:00 2001 From: Mike Cheng Date: Wed, 6 May 2015 11:23:27 -0400 Subject: [PATCH] Don't always run check on root domain --- dyndns/daemon.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dyndns/daemon.go b/dyndns/daemon.go index 1d836cb..95dfdd1 100644 --- a/dyndns/daemon.go +++ b/dyndns/daemon.go @@ -14,12 +14,12 @@ import ( var wg sync.WaitGroup func contains(c api.Config, val string) bool { - if val == c.Domain { - return true - } - for _, v := range c.Hostnames { - if fmt.Sprintf("%s.%s", v, c.Domain) == val { + // We have a special case where an empty hostname + // is equivalent to the domain (i.e. val == domain). + if val == c.Domain && v == "" { + return true + } else if fmt.Sprintf("%s.%s", v, c.Domain) == val { return true } }