From acf4bc9979cfae8046bb60fb3be628f508632328 Mon Sep 17 00:00:00 2001
From: Frederik Lindenaar <frederik@lindenaar.nl>
Date: Mon, 5 Aug 2019 21:29:09 +0200
Subject: [PATCH] Fixed issue with listing the domain without 'domain' parameter

---
 dyndns.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dyndns.pl b/dyndns.pl
index f65e286..6668555 100755
--- a/dyndns.pl
+++ b/dyndns.pl
@@ -417,7 +417,7 @@ foreach my $d (@DNSDomain) {
         if ($d <0) { $d = join('.', splice(@{[ split(/\./, $cgi->virtual_host) ]}, $d)); }
         else { $d = join('.', splice(@{[ split(/\./, $host) ]}, ($d) ? -$d : 1)); }
     }
-    $dnsdomain = $d if ($host && length($host) == length($d)+rindex($host,$d));
+    $dnsdomain = $d if (!$host || length($host) == length($d)+rindex($host,$d));
     last if $dnsdomain;
 }
 fail($PE, "No host name to act on specified", 400)
--
libgit2 0.22.2