# to <subdomain>.<zone>, and so must not have a trailing `.';
# where the owner is to be <subdomain>.<zone>, `@' must be used.
+# Copyright 1996-2013 Ian Jackson <ijackson@chiark.greenend.org.uk>
+# Copyright 1998 David Damerell <damerell@chiark.greenend.org.uk>
+# Copyright 1999,2003
+# Chancellor Masters and Scholars of the University of Cambridge
+# Copyright 2010 Tony Finch <fanf@dotat.at>
+#
+# This is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with userv-utils; if not, see http://www.gnu.org/licenses/.
+
use POSIX;
BEGIN {
$vardir= "/var/lib/userv/dyndns";
$defconf= "/etc/userv/dyndns-domains";
- $libdir= "/usr/local/lib/userv/dyndns";
+ $libdir= "/usr/share/userv/dyndns";
}
END {
remove "$vardir/tmp/$$" or $! == ENOENT or
use FileHandle;
use IO::File;
use Socket;
+use Socket6;
@ARGV==2 or die "need <zone> and <domain> arguments\n";
($zone,$subdomain) = @ARGV;
defined($addr= inet_aton $_) or
die "input:$.:$owner:invalid IP address\n";
$data= inet_ntoa($addr);
+ } elsif ($type eq 'AAAA') {
+ defined($addr= inet_pton(AF_INET6, $_)) or
+ die "input:$.:$owner:invalid IPv6 address\n";
+ $data = inet_ntop(AF_INET6, $addr);
} elsif ($type eq 'CNAME') {
$data= domainsyntax_rel("input:$.:$owner:canonical name",$_).".";
} elsif ($type eq 'MX') {