diff --git a/html/cgi-bin/ddns.cgi b/html/cgi-bin/ddns.cgi
index e5fe7166f..2c075a4c8 100644
--- a/html/cgi-bin/ddns.cgi
+++ b/html/cgi-bin/ddns.cgi
@@ -445,8 +445,9 @@ print $form->render();
 -e $datafile or die "Unable to open $datafile.";
 @current = &General::read_file($datafile, { keep_newlines => 1 });
 
-# Get IP address of the red interface.
-my $ip = &HTTPClient::GetDyndnsRedIP();
+# The address of the hosts, which may have to be fetched from a server: only
+# get it when needed
+my $ip;
 my $id = 0;
 my $toggle_enabled;
 
@@ -484,6 +485,7 @@ if (@current) {
 			$fqdn =~ s/^[\*\@]\.//;
 
 			if (&Network::check_fqdn($fqdn)) {
+				$ip //= &HTTPClient::GetDyndnsRedIP();
 				$sync = (&HTTPClient::DyndnsServiceSync ($ip,$temp[1], $temp[2]) ? "has-text-success" : "has-text-danger");
 			}
 
