if [ "${nft_remote}" != "1" ] || [ -z "${nft_macremote}" ]; then
printf '%s\n' "
<div class=\"msg err\">
- Remote allow is not enabled or no MAC addresses configured
+ Adblock Remote Allow is not enabled or no MAC addresses configured
</div>
</div></body></html>"
exit 0
if [ -z "${query_mac}" ]; then
printf '%s\n' "
<div class=\"msg err\">
- Could not determine MAC address
+ MAC address could not be determined
</div>
</div></body></html>"
exit 0
: >"${tmp_result}"
read -r search_start _ < "/proc/uptime"
search_start="${search_start%.*}"
+
+ # search recursively for domain and its parent domains until tld is reached
+ #
while :; do
search="${domain//./\\.}"
res="$("${adb_awkcmd}" -F '/|\"|\t| ' "/^(${prefix}${search}${suffix})$/{i++;if(i<=9){printf \" + %s\n\",\$${field}}else if(i==10){printf \" + %s\n\",\"[...]\";exit}}" "${adb_finaldir}/${adb_dnsfile}")"
domain="${tld}"
tld="${domain#*.}"
done
+
+ # search exactly for domain in backup files and local block-/allowlist
+ #
if [ -d "${adb_backupdir}" ]; then
search="${1//./\\.}"
printf '%s\n%s\n%s\n' ":::" "::: domain '${1}' in backups and in local block-/allowlist" ":::" >>"${tmp_result}"
# ignore Reverse DNS
/\.in-addr\.arpa/ || /\.ip6\.arpa/ { next }
# domain request parser (with optional EDNS marker support)
- /\+[[:space:]]+(\[.*\][[:space:]]+)?(A\?|AAAA\?)/ {
+ /\+[[:space:]]+(\[[0-9a-z]*\][[:space:]]+)?(A\?|AAAA\?)/ {
# drop unresolved previous query
if (pending)
pending = 0
sub(/[,\.]+$/, "", domain)
if (domain ~ /\.lan$/) next
if (domain !~ /\./) next
+ if (domain ~ /[\/:]/) next
qtype = $(NF-2)
sub(/\?$/, "", qtype)
last_date = date