From 1e04ec37c3f8af1b8f0bca3ad37483c85add7daf Mon Sep 17 00:00:00 2001 From: Frederik Lindenaar Date: Sat, 27 Dec 2025 19:35:41 +0100 Subject: [PATCH] updated version and copyright updated documentation to reflect the migration to Gitea correctly handle IPv4 or IPv6 addresses to be empty added Remote, IPv4 and IPv6 addresses to the debug output --- CHANGELOG | 5 +++++ README.md | 18 +++++++++--------- dyndns.pl | 17 ++++++++++------- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b7b6fa1..5d128da 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,11 @@ CHANGELOG ========= +Version 1.2 Changes (2025-12-27): + * migrated to my new Gitea instance + * correctly handle IPv4 or IPv6 addresses to be empty + * added Remote, IPv4 and IPv6 addresses to the debug output + Version 1.1 Changes (2019-08-05): * Enhancements: * Added config file support and a sample config file diff --git a/README.md b/README.md index 3f27568..c70fc07 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,10 @@ Perl CGI-BIN script to handle Dynamic DNS updates through HTTP (e.g. from a router), updating DNS records through secure DNS update statements to run your own Dynamic DNS Service. -**Version 1.1**, latest version, documentation and bugtracker available on my -[GitLab instance](https://gitlab.lindenaar.net/scripts/dyndns) +**Version 1.2**, latest version, documentation and bugtracker available on my +[Gitea instance](https://gitea.lindenaar.net/scripts/dyndns) -Copyright (c) 2013 - 2019 Frederik Lindenaar. free for distribution under the +Copyright (c) 2013 - 2025 Frederik Lindenaar. free for distribution under the GNU License, see [below](#license) @@ -49,17 +49,17 @@ consider using the Apache mod_perl module for highly a volatile domain. The setup of this solution consists of the following steps: 1. Ensure that the Perl modules CGI and Net::DNS are installed. - * on Debian/Ubuntu linux this can be done with: + * on Debian/Ubuntu linux this can be done with: -~~~ + ~~~ sudo apt-get install libcgi-pm-perl libnet-dns-perl -~~~ + ~~~ - * or directly from CPAN (assuming that is installed): + * or directly from CPAN (assuming that is installed): -~~~ + ~~~ cpan CGI Net::DNS -~~~ + ~~~ 2. Install the file `dyndns.pl` either in your cgi-bin directory or in a separate folder diff --git a/dyndns.pl b/dyndns.pl index 0dd3b25..353521a 100755 --- a/dyndns.pl +++ b/dyndns.pl @@ -3,10 +3,10 @@ # # dyndns.pl - CGI-BIN script to handle Dynamic DNS updates through http # -# Version 1.1, latest version, documentation and bugtracker available at: -# https://gitlab.lindenaar.net/scripts/dyndns +# Version 1.2, latest version, documentation and bugtracker available at: +# https://gitea.lindenaar.net/scripts/dyndns # -# Copyright (c) 2013 - 2019 Frederik Lindenaar +# Copyright (c) 2013 - 2025 Frederik Lindenaar # # This script is free software: you can redistribute and/or modify it under the # terms of version 3 of the GNU General Public License as published by the Free @@ -207,6 +207,9 @@ sub DNS_Update($$$$$$$) { my $debugmessage = ($debug) ? "\n\n\n========================================================\n" . + "Remote addr: ". $cgi->remote_addr . "\n". + "IPv4 addr: ". $ipv4 . "\n". + "IPv6 addr: ". $ipv6 . "\n". $dnsupdate->string . "\n" : "\n"; @@ -243,12 +246,12 @@ sub handle_update($$$$) { } else { # Get ipv4, and ipv6 parameters my $remote_addr = $cgi->remote_addr; - my $ipv4addr = $cgi->param('ipv4addr') || $cgi->param('ip'); - if ($ipv4addr == 'auto') { + my $ipv4addr = $cgi->param('ipv4addr') || $cgi->param('ip') || ''; + if ($ipv4addr && $ipv4addr == 'auto') { $ipv4addr = is_ipv4($remote_addr) ? $remote_addr : undef; } - my $ipv6addr = $cgi->param('ipv6addr') || $cgi->param('ipv6'); - if ($ipv6addr == 'auto') { + my $ipv6addr = $cgi->param('ipv6addr') || $cgi->param('ipv6') || ''; + if ($ipv6addr && $ipv6addr == 'auto') { $ipv6addr = is_ipv6($remote_addr) ? $remote_addr : undef; } ($statuscode, $statusmessage) =