Skip to content

Commit acbaedd

Browse files
committed
unbound: allow additional search domains
Add a config option add_search to allow the addition of additional domains to the /etc/resolv.conf search option.
1 parent 4369bd6 commit acbaedd

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

net/unbound/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
99

1010
PKG_NAME:=unbound
1111
PKG_VERSION:=1.24.2
12-
PKG_RELEASE:=1
12+
PKG_RELEASE:=2
1313

1414
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
1515
PKG_SOURCE_URL:=https://nlnetlabs.nl/downloads/unbound

net/unbound/files/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ One instance is supported currently.
203203
| --- | ------- | ----- | ----------- | ------- |
204204
| add_extra_dns | 0 | level | Read OpenWrt traditional options for `dnsmasq`.<br>`0`: Disabled<br>`1`: Use only domain<br>`2`: Use domain, mxhost, and srvhost<br>`3`: Use all cname, domain, mxhost, and srvhost | local-data: |
205205
| add_local_fqdn | 0 | level | Each level puts a more detailed router entry within the LAN DNS (except link).<br>`0`: Disabled<br>`1`: Host name on the primary address<br>`2`: Host name on all addresses<br>`3`: FQDN and host name on all addresses<br>`4`: FQDN defined by "iface.hostname.domain" | local-zone: local-data: |
206+
| add_search | (empty) | | Additional zones to add to `/etc/resolv.conf`'s `search` directive | - |
206207
| add_wan_fqdn | 0 | level | Same as `add_local_fqdn` but on WAN as listed in `iface_wan` | local-zone: local-data: |
207208
| dns64 | 0 | boolean | Enable DNS64 RFC6052 to bridge IPv4 and IPv6 networks. | module: dns64 |
208209
| dns64_prefix | 64:ff9b::/96 | subnet | DNS64 RFC6052 IPv4 in IPv6 well known prefix. | dns64-prefix: |

net/unbound/files/unbound.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,7 @@ unbound_uci() {
13751375

13761376
config_get UB_TTL_MIN "$cfg" ttl_min 120
13771377
config_get UB_TXT_DOMAIN "$cfg" domain lan
1378+
config_get UB_ADD_SEARCH "$cfg" add_search ''
13781379
config_get UB_NEG_TTL_MAX "$cfg" ttl_neg_max 1000
13791380

13801381
config_list_foreach "$cfg" domain_insecure bundle_domain_insecure
@@ -1565,7 +1566,12 @@ resolv_setup() {
15651566
echo "# $UB_RESOLV_CONF generated by Unbound UCI $( date -Is )"
15661567
echo "nameserver 127.0.0.1"
15671568
echo "nameserver ::1"
1568-
echo "search $UB_TXT_DOMAIN."
1569+
echo -n "search"
1570+
local domain
1571+
for domain in $UB_ADD_SEARCH; do
1572+
echo -n " ${domain%.}."
1573+
done
1574+
echo " $UB_TXT_DOMAIN."
15691575
} > $UB_RESOLV_CONF
15701576
fi
15711577
}

0 commit comments

Comments
 (0)