[root@ipf ~]# cat /etc/unbound/forward.conf
# This file is automatically generated and any changes
# will be overwritten. DO NOT EDIT!
stub-zone:
name:
stub-addr: 1.1.1.2
It is unfortunately no surprise :(.
The function validdomainname() in generalfunctions.pl accepts empty strings as valid.
sub validdomainname
{
my $part;
# Checks a domain name against RFC1035 and RFC2181
my $domainname = $_[0];
my @parts = split (/\./, $domainname); # Split domain name at the '.'
foreach $part (@parts) {
# Each part should be at least one character in length
# but no more than 63 characters
if (length ($part) < 1 || length ($part) > 63) {
return 0;}
# Only valid characters are a-z, A-Z, 0-9, _ and -
if ($part !~ /^[a-zA-Z0-9_-]*$/) {
return 0;}
}
return 1;
}
If $domainname is empty, @parts is an array with no elements. So the foreach loop is a nop statement.
by the way, I still did not get why you want or have to configure DNS forwarding for an empty zone.
This implies Unbound will forward requests for any FQDN asked to the server specified, which is exactly what this GUI does.
Wouldn’t assigning DNS servers directly be the straight-forward way?
Oh, thanks for digging into this.
This kinda looks like we skipped the test for empty inputs intentionally, since that one would be the first thing to check in my point of view. Perhaps we need this function somewhere where a blank input is fine, but that would be ugly as well.
Either way, I’ll file a bug to clarify this.
EDIT: Please refer to #12648 for the Bugzilla entry.