Time for some experiments: i changed my router from dnsmasq + https dns proxy to unbound + odhcpd. I checked the readme etc. and it seems to work for now. But now i have a lot of warnings in my log on every restart [16.01.2026, 20:05:13 MEZ] daemon.warn: unbound: [21208:0] warning: duplicate local-zone joek.eu. [16.01.2026, 20:05:13 MEZ] daemon.warn: unbound: [21208:0] warning: duplicate local-zone joek.eu. [16.01.2026, 20:05:13 MEZ] daemon.warn: unbound: [21208:0] warning: duplicate local-zone joek.eu. [16.01.2026, 20:05:13 MEZ] daemon.warn: unbound: [21208:0] warning: duplicate local-zone joek.eu. [16.01.2026, 20:05:13 MEZ] daemon.warn: unbound: [21208:0] warning: duplicate local-zone joek.eu. [16.01.2026, 20:05:13 MEZ] daemon.warn: unbound: [21208:0] warning: duplicate local-zone joek.eu. [16.01.2026, 20:05:13 MEZ] daemon.warn: unbound: [21208:0] warning: duplicate local-zone joek.eu.
The list is even longer than this. What i‘m doing wrong here? I have a lot of static leases configured, and also some hostnames and cname defined.
Second thing: is it possible to configure unbound so it answers to „nslookup myhostname“ like „nslookup myhostname.joek.eu“. I find it funny, on the router itself it works, but clients don‘t get an answer.
I think there’s a flaw in this function where it doesn’t fully recognize that it’s already seen your joek.eu domain already and keeps adding it multiple times. target has the entire FQDN, but in practice, it should only contain the domain part.
What if you move the partial value earlier before the case to only include the last 2 parts of the domain? And use partial instead of target in the case?
create_local_zone() {
local target="$1"
local partial domain found
partial=$( echo "$target" | awk -F. '{ j=NF ; i=j-1; print $i"."$j }' )
case $DM_LIST_TRN_ZONES in
*" ${partial} "*)
found=1
;;
*)
case $target in
[A-Za-z0-9]*.[A-Za-z0-9]*)
found=0
;;
*) # no dots
found=1
;;
esac
esac
if [ $found -eq 0 ] ; then
# New Zone! Bundle local-zones: by first two name tiers "abcd.tld."
DM_LIST_TRN_ZONES="$DM_LIST_TRN_ZONES $partial "
DM_LIST_KNOWN_ZONES="$DM_LIST_KNOWN_ZONES $partial "
fi
}
yes. moved the partial value, changed the case match and added a trailing space in the list. so the matching pattern is blankDomain.tldblank
no duplicates anymore. still warnings because joek.eu is included one time static and one time transparent
Second version, so if the domain is already known and static it won’t be added at all:
create_local_zone() {
local target="$1"
local partial domain found
partial=$( echo "$target" | awk -F. '{ j=NF ; i=j-1; print $i"."$j }' )
# Zone ist bereits bekannt (z. B. Router-Domain)
case " $DM_LIST_KNOWN_ZONES " in
*" $partial "*) return ;;
esac
case " $DM_LIST_TRN_ZONES " in
*" ${partial} "*)
found=1
;;
*)
case $target in
[A-Za-z0-9]*.[A-Za-z0-9]*)
found=0
;;
*) # no dots
found=1
;;
esac
esac
if [ $found -eq 0 ] ; then
# New Zone! Bundle local-zones: by first two name tiers "abcd.tld."
DM_LIST_TRN_ZONES="$DM_LIST_TRN_ZONES $partial "
DM_LIST_KNOWN_ZONES="$DM_LIST_KNOWN_ZONES $partial "
fi
}