Suppress displaying unsupported records so that DNSSEC (RRSIG records) are no issue
(closes #2)
This commit is contained in:
23
dyndns.pl
23
dyndns.pl
@@ -3,10 +3,10 @@
|
|||||||
#
|
#
|
||||||
# dyndns.pl - CGI-BIN script to handle Dynamic DNS updates through http
|
# dyndns.pl - CGI-BIN script to handle Dynamic DNS updates through http
|
||||||
#
|
#
|
||||||
# Version 1.0, latest version, documentation and bugtracker available at:
|
# Version 1.1, latest version, documentation and bugtracker available at:
|
||||||
# https://gitlab.lindenaar.net/scripts/dyndns
|
# https://gitlab.lindenaar.net/scripts/dyndns
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013 Frederik Lindenaar
|
# Copyright (c) 2013 - 2019 Frederik Lindenaar
|
||||||
#
|
#
|
||||||
# This script is free software: you can redistribute and/or modify it under the
|
# 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
|
# terms of version 3 of the GNU General Public License as published by the Free
|
||||||
@@ -104,7 +104,7 @@ sub DNS_decode_rr($) {
|
|||||||
return $rr->nsdname if($rr->type eq 'NS');
|
return $rr->nsdname if($rr->type eq 'NS');
|
||||||
return $rr->exchange.' (priority '.$rr->preference.')' if($rr->type eq 'MX');
|
return $rr->exchange.' (priority '.$rr->preference.')' if($rr->type eq 'MX');
|
||||||
return $rr->cpu.', '.$rr->os if($rr->type eq 'HINFO');
|
return $rr->cpu.', '.$rr->os if($rr->type eq 'HINFO');
|
||||||
die "No support for $rr->type in DNS_get()!, aborted!";
|
die "No support for $rr " . $rr->type . " in DNS_decode_rr()!, aborted!";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Retrieve a single value from the DNS server of a given type or everything
|
# Retrieve a single value from the DNS server of a given type or everything
|
||||||
@@ -285,9 +285,9 @@ sub handle_view($$$$$$) {
|
|||||||
$cgi->th(['Field', 'Value'])
|
$cgi->th(['Field', 'Value'])
|
||||||
]);
|
]);
|
||||||
foreach my $rr (DNS_get($dnshost)->answer) {
|
foreach my $rr (DNS_get($dnshost)->answer) {
|
||||||
print $cgi->Tr([
|
if(my $label = $DNS_label{$rr->type}) {
|
||||||
$cgi->td([$DNS_label{$rr->type}, DNS_decode_rr($rr)])
|
print $cgi->Tr([ $cgi->td([$label, DNS_decode_rr($rr)]) ]);
|
||||||
]);
|
}
|
||||||
}
|
}
|
||||||
print $cgi->end_table();
|
print $cgi->end_table();
|
||||||
|
|
||||||
@@ -310,11 +310,11 @@ sub handle_list($$$$$$) {
|
|||||||
my $lastname = '';
|
my $lastname = '';
|
||||||
foreach my $rr (getResolver->axfr($dnsdomain)) {
|
foreach my $rr (getResolver->axfr($dnsdomain)) {
|
||||||
next if($rr->name eq $dnsdomain);
|
next if($rr->name eq $dnsdomain);
|
||||||
print $cgi->Tr([
|
if(my $label = $DNS_label{$rr->type}) {
|
||||||
$cgi->td([ ($lastname cmp $rr->name) ? $rr->name : '',
|
print $cgi->Tr([ $cgi->td([ ($lastname cmp $rr->name) ? $rr->name : '',
|
||||||
$DNS_label{$rr->type}, DNS_decode_rr($rr)])
|
$label, DNS_decode_rr($rr)]) ]);
|
||||||
]);
|
$lastname = $rr->name;
|
||||||
$lastname = $rr->name;
|
}
|
||||||
}
|
}
|
||||||
print $cgi->end_table();
|
print $cgi->end_table();
|
||||||
|
|
||||||
@@ -374,3 +374,4 @@ if($host eq '' and $mode cmp 'list' and $mode cmp 'expire') {
|
|||||||
-type=>'text/plain'),
|
-type=>'text/plain'),
|
||||||
"ERROR - File Not Found / Invalid Mode '$mode' specified\n";
|
"ERROR - File Not Found / Invalid Mode '$mode' specified\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user