aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2026-06-27 20:52:32 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2026-06-27 21:13:38 +0000
commitded28c51566f93c14a84645898b48f212c3f7cc8 (patch)
tree2b665b9c28b2942b7f24cb84e2ac59038838a1bf
parent43ade7d9e9170654b2866b20cb35d5743beda925 (diff)
Strip leading dots as we do trailing dots from domainsvendor/openresolv
Seems some routers do this and this breaks unbound at least. Based on a patch from Dag-Erling Smørgrav <des@FreeBSD.org>
-rw-r--r--resolvconf.in3
1 files changed, 3 insertions, 0 deletions
diff --git a/resolvconf.in b/resolvconf.in
index 2f55a9de0eda..f6975cbec928 100644
--- a/resolvconf.in
+++ b/resolvconf.in
@@ -922,11 +922,14 @@ tolower() {
# Strip any trailing dot from each name as a FQDN does not belong
# in resolv.conf(5).
+# Likewise, strip any leading dot from poorly configured routers
+# as some sunscribers don't work with that.
# While DNS is not case sensitive, our labels for building the zones
# are, so ensure it's lower case.
process_domain()
{
for word in $(tolower "$@"); do
+ word="${word#.}"
printf "%s " "${word%.}"
done
printf "\n"