Date: Tue, 28 Apr 2026 19:38:20 +0000 From: Siva Mahadevan <siva@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: cb0e3a5fba5f - main - contrib/openresolv: MFV openresolv 3.17.4 Message-ID: <69f10cac.32d91.6f38f8d4@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by siva: URL: https://cgit.FreeBSD.org/src/commit/?id=cb0e3a5fba5fe48607db8c1042bfe6a1164e0db7 commit cb0e3a5fba5fe48607db8c1042bfe6a1164e0db7 Merge: e139a49b5d8e 43ade7d9e917 Author: Siva Mahadevan <siva@FreeBSD.org> AuthorDate: 2026-04-28 19:25:49 +0000 Commit: Siva Mahadevan <siva@FreeBSD.org> CommitDate: 2026-04-28 19:26:59 +0000 contrib/openresolv: MFV openresolv 3.17.4 Reviewed by: pfg Approved by: lwhsu (mentor) Differential Revision: https://reviews.freebsd.org/D56269 contrib/openresolv/LICENSE | 2 +- contrib/openresolv/Makefile | 54 +- contrib/openresolv/README.md | 9 +- contrib/openresolv/avahi-daemon.in | 32 ++ contrib/openresolv/configure | 4 +- contrib/openresolv/dnsmasq.in | 8 +- contrib/openresolv/libc.in | 82 ++- contrib/openresolv/mdnsd.in | 32 ++ contrib/openresolv/named.in | 4 +- contrib/openresolv/pdns_recursor.in | 4 +- contrib/openresolv/pdnsd.in | 10 +- contrib/openresolv/resolvconf.8.in | 226 +++++--- contrib/openresolv/resolvconf.conf.5.in | 182 ++++-- contrib/openresolv/resolvconf.in | 947 +++++++++++++++++++++++++------- contrib/openresolv/resolvectl.in | 159 ++++++ contrib/openresolv/systemd-resolved.in | 96 ++++ contrib/openresolv/unbound.in | 30 +- 17 files changed, 1484 insertions(+), 397 deletions(-) diff --cc contrib/openresolv/Makefile index 6cfa6e4ea072,000000000000..ba9a75d35f22 mode 100644,000000..100644 --- a/contrib/openresolv/Makefile +++ b/contrib/openresolv/Makefile @@@ -1,118 -1,0 +1,138 @@@ +PKG= openresolv + +# Nasty hack so that make clean works without configure being run +_CONFIG_MK!= test -e config.mk && echo config.mk || echo config-null.mk +CONFIG_MK?= ${_CONFIG_MK} +include ${CONFIG_MK} + ++DIST!= if test -d .git; then echo "dist-git"; \ ++ else echo "dist-inst"; fi ++ +SBINDIR?= /sbin +SYSCONFDIR?= /etc +LIBEXECDIR?= /libexec/resolvconf +VARDIR?= /var/run/resolvconf + +ECHO?= echo +INSTALL?= install +SED?= sed + +VERSION!= ${SED} -n 's/OPENRESOLV_VERSION="\(.*\)".*/\1/p' resolvconf.in + +BINMODE?= 0755 +DOCMODE?= 0644 +MANMODE?= 0444 + - RESOLVCONF= resolvconf resolvconf.8 resolvconf.conf.5 - SUBSCRIBERS= libc dnsmasq named pdnsd pdns_recursor unbound - TARGET= ${RESOLVCONF} ${SUBSCRIBERS} ++RESOLVCONF= resolvconf resolvconf.8 resolvconf.conf.5 ++SUBSCRIBERS= libc dnsmasq named pdnsd pdns_recursor unbound ++SUBSCRIBERS+= systemd-resolved resolvectl ++LIBC_SUBSCRIBERS= avahi-daemon mdnsd ++TARGET= ${RESOLVCONF} ${SUBSCRIBERS} ${LIBC_SUBSCRIBERS} +SRCS= ${TARGET:C,$,.in,} # pmake +SRCS:= ${TARGET:=.in} # gmake + +SED_SBINDIR= -e 's:@SBINDIR@:${SBINDIR}:g' +SED_SYSCONFDIR= -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' +SED_LIBEXECDIR= -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g' +SED_VARDIR= -e 's:@VARDIR@:${VARDIR}:g' +SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g' +SED_RESTARTCMD= -e 's:@RESTARTCMD@:${RESTARTCMD}:g' +SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g' +SED_STATUSARG= -e 's:@STATUSARG@:${STATUSARG}:g' + +DISTPREFIX?= ${PKG}-${VERSION} - DISTFILEGZ?= ${DISTPREFIX}.tar.gz +DISTFILE?= ${DISTPREFIX}.tar.xz +DISTINFO= ${DISTFILE}.distinfo - DISTINFOSIGN= ${DISTINFO}.asc - CKSUM?= cksum -a SHA256 - PGP?= netpgp ++DISTINFOMD= ${DISTINFO}.md ++DISTSIGN= ${DISTFILE}.asc ++SHA256?= sha256 ++PGP?= gpg2 + +GITREF?= HEAD + +.SUFFIXES: .in + +all: ${TARGET} + +.in: Makefile ${CONFIG_MK} + ${SED} ${SED_SBINDIR} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \ + ${SED_VARDIR} \ + ${SED_RCDIR} ${SED_RESTARTCMD} ${SED_RCDIR} ${SED_STATUSARG} \ + $< > $@ + +clean: + rm -f ${TARGET} + +distclean: clean - rm -f config.mk ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN} ++ rm -f config.mk ${DISTFILE} ${DISTINFO} ${DISTINFOMD} ${DISTSIGN} + +installdirs: + +proginstall: ${TARGET} + ${INSTALL} -d ${DESTDIR}${SBINDIR} + ${INSTALL} -m ${BINMODE} resolvconf ${DESTDIR}${SBINDIR} + ${INSTALL} -d ${DESTDIR}${SYSCONFDIR} + test -e ${DESTDIR}${SYSCONFDIR}/resolvconf.conf || \ + ${INSTALL} -m ${DOCMODE} resolvconf.conf ${DESTDIR}${SYSCONFDIR} + ${INSTALL} -d ${DESTDIR}${LIBEXECDIR} + ${INSTALL} -m ${DOCMODE} ${SUBSCRIBERS} ${DESTDIR}${LIBEXECDIR} ++ ${INSTALL} -d ${DESTDIR}${LIBEXECDIR}/libc.d ++ ${INSTALL} -m ${DOCMODE} ${LIBC_SUBSCRIBERS} \ ++ ${DESTDIR}${LIBEXECDIR}/libc.d + +maninstall: + ${INSTALL} -d ${DESTDIR}${MANDIR}/man8 + ${INSTALL} -m ${MANMODE} resolvconf.8 ${DESTDIR}${MANDIR}/man8 + ${INSTALL} -d ${DESTDIR}${MANDIR}/man5 + ${INSTALL} -m ${MANMODE} resolvconf.conf.5 ${DESTDIR}${MANDIR}/man5 + +install: proginstall maninstall + +dist-git: + git archive --prefix=${DISTPREFIX}/ ${GITREF} | xz >${DISTFILE} + +dist-inst: + mkdir /tmp/${DISTPREFIX} + cp -RPp * /tmp/${DISTPREFIX} + (cd /tmp/${DISTPREFIX}; make clean) - tar -cvjpf ${DISTFILE} -C /tmp ${DISTPREFIX} ++ tar -cvJpf ${DISTFILE} -C /tmp ${DISTPREFIX} + rm -rf /tmp/${DISTPREFIX} + - dist: dist-git ++dist: ${DIST} + +distinfo: dist - rm -f ${DISTINFO} ${DISTINFOSIGN} - ${CKSUM} ${DISTFILE} >${DISTINFO} - #printf "SIZE (${DISTFILE}) = %s\n" $$(wc -c <${DISTFILE}) >>${DISTINFO} - ${PGP} --clearsign --output=${DISTINFOSIGN} ${DISTINFO} - chmod 644 ${DISTINFOSIGN} - ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN} ++ rm -f ${DISTINFO} ${DISTSIGN} ++ ${SHA256} ${DISTFILE} >${DISTINFO} ++ wc -c <${DISTFILE} \ ++ | xargs printf 'Size (${DISTFILE}) = %s\n' >>${DISTINFO} ++ ${PGP} --sign --armour --detach ${DISTFILE} ++ chmod 644 ${DISTSIGN} ++ ls -l ${DISTFILE} ${DISTINFO} ${DISTSIGN} ++ ++${DISTINFOMD}: ${DISTINFO} ++ echo '```' >${DISTINFOMD} ++ cat ${DISTINFO} >>${DISTINFOMD} ++ echo '```' >>${DISTINFOMD} ++ ++release: distinfo ${DISTINFOMD} ++ gh release create v${VERSION} \ ++ --title "openresolv ${VERSION}" --draft --generate-notes \ ++ --notes-file ${DISTINFOMD} \ ++ ${DISTFILE} ${DISTSIGN} + +import: dist + rm -rf /tmp/${DISTPREFIX} + ${INSTALL} -d /tmp/${DISTPREFIX} + tar xvJpf ${DISTFILE} -C /tmp + +_import-src: + rm -rf ${DESTDIR}/* + ${INSTALL} -d ${DESTDIR} + cp LICENSE README.md ${SRCS} resolvconf.conf ${DESTDIR}; + cp resolvconf.8.in resolvconf.conf.5.in ${DESTDIR}; + @${ECHO} + @${ECHO} "=============================================================" + @${ECHO} "openresolv-${VERSION} imported to ${DESTDIR}" + +import-src: - ${MAKE} _import-src DESTDIR=`if [ -n "${DESTDIR}" ]; then echo "${DESTDIR}"; else echo /tmp/${DISTPREFIX}; fi` ++ ${MAKE} _import-src DESTDIR=`if [ -n "${DESTDIR}" ]; then echo "${DESTDIR}"; else echo /tmp/${DISTPREFIX}; fi` diff --cc contrib/openresolv/README.md index 739cc73356cb,000000000000..50e54ced93ef mode 100644,000000..100644 --- a/contrib/openresolv/README.md +++ b/contrib/openresolv/README.md @@@ -1,64 -1,0 +1,69 @@@ +# openresolv + +openresolv is a [resolvconf](https://en.wikipedia.org/wiki/Resolvconf) +implementation which manages `/etc/resolv.conf`. + +`/etc/resolv.conf` is a file that holds the configuration for the local +resolution of domain names. +Normally this file is either static or maintained by a local daemon, +normally a DHCP daemon. But what happens if more than one thing wants to +control the file? +Say you have wired and wireless interfaces to different subnets and run a VPN +or two on top of that, how do you say which one controls the file? +It's also not as easy as just adding and removing the nameservers each client +knows about as different clients could add the same nameservers. + +Enter resolvconf, the middleman between the network configuration services and +`/etc/resolv.conf`. +resolvconf itself is just a script that stores, removes and lists a full +`resolv.conf` generated for the interface. It then calls all the helper scripts +it knows about so it can configure the real `/etc/resolv.conf` and optionally +any local nameservers other than libc. + +## Reasons for using openresolv + +Why openresolv over the +[Debian implementation](http://qref.sourceforge.net/Debian/reference/ch-gateway.en.html#s-dns-resolvconf)? +Here's some reasons: + * Works with + [POSIX shell and userland](http://www.opengroup.org/onlinepubs/009695399) + * Does not need awk, grep or sed which means we can work without `/usr` + mounted + * Works with other init systems than Debians' out of the box + * Available as a 2 clause + [BSD license](http://www.freebsd.org/copyright/freebsd-license.html) + * Prefer configs via IF_METRIC for dynamic ordering + * Configures zones for local resolvers other than libc + +The last point is quite important, especially when running VPN systems. +Take the following resolv.conf files which have been generated by a - [DHCP client](../dhcpcd) and sent to resolvconf: ++[DHCP client](https://github.com/NetworkConfiguration/dhcpcd) and sent to resolvconf: + +``` +# resolv.conf from bge0 +search foo.com +nameserver 1.2.3.4 + +# resolv.conf from tap0 +domain bar.org +nameserver 5.6.7.8 +``` + +In this instance, queries for foo.com will go to 1.2.3.4 and queries for +bar.org will go to 5.6.7.8. +This does require the resolvers to be configured to pickup the resolvconf +generated configuration for them though. +openresolv ships with helpers for: + * [unbound](http://www.unbound.net/) + * [dnsmasq](http://www.thekelleys.org.uk/dnsmasq/doc.html) + * [ISC BIND](http://www.isc.org/software/bind) + * [PowerDNS Recursor](http://wiki.powerdns.com/trac) ++ * [systemd-resolved](https://www.freedesktop.org/software/systemd/man/latest/systemd-resolved.service.html) + +See the - [configuration section](https://roy.marples.name/projects/openresolv/config) ++[configuration section](https://roy.marples.name/projects/openresolv/configuration) +for more details. ++ ++If openresolv updates `/etc/resolv.conf` it can notify the following of this: ++ * [Bonjour (mdnsd)](https://developer.apple.com/bonjour/) ++ * [avahi](http://www.avahi.org/) diff --cc contrib/openresolv/avahi-daemon.in index 000000000000,cdac44fe8234..cdac44fe8234 mode 000000,100644..100644 --- a/contrib/openresolv/avahi-daemon.in +++ b/contrib/openresolv/avahi-daemon.in diff --cc contrib/openresolv/configure index c9422b74b69c,50fe74da8baa..50fe74da8baa mode 100644,100755..100755 --- a/contrib/openresolv/configure +++ b/contrib/openresolv/configure diff --cc contrib/openresolv/mdnsd.in index 000000000000,3b01cd459f16..3b01cd459f16 mode 000000,100644..100644 --- a/contrib/openresolv/mdnsd.in +++ b/contrib/openresolv/mdnsd.in diff --cc contrib/openresolv/resolvectl.in index 000000000000,167aac62ba57..167aac62ba57 mode 000000,100644..100644 --- a/contrib/openresolv/resolvectl.in +++ b/contrib/openresolv/resolvectl.in diff --cc contrib/openresolv/systemd-resolved.in index 000000000000,0190a73723e5..0190a73723e5 mode 000000,100644..100644 --- a/contrib/openresolv/systemd-resolved.in +++ b/contrib/openresolv/systemd-resolved.inhome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69f10cac.32d91.6f38f8d4>
