RESOLVCONF(8)
โจ RESOLVCONF(8) โจ
okay so bestie, this is resolvconf โ it lives in the System Manager's Manual section of your life, and it's genuinely one of those tools that fixes a problem you didn't even know you had. Buckle up ๐
๐ NAME ๐
resolvconf โ a framework for managing multiple DNS configurations. yes, multiple. it's giving "adulting for your /etc/resolv.conf" ๐
๐ธ SYNOPSIS ๐ธ
resolvconf -I
resolvconf [-m metric] [-p] [-x] -a key <file
resolvconf -C pattern
resolvconf -c pattern
resolvconf [-f] -d key
resolvconf [-x] -iLlp pattern
resolvconf -u
resolvconf --version
๐ฆ DESCRIPTION ๐ฆ
so resolvconf manages resolv.conf(5) files from multiple sources โ think DHCP and VPN clients, the whole squad. back in the day, traditionally, the host runs just one client and that one client updates /etc/resolv.conf. cute! simple! but more modern systems frequently have wired and wireless interfaces, and there is no guarantee both are on the same network. and with the advent of VPN and other types of networking daemons, many things now contend for the contents of /etc/resolv.conf. it's a whole fight in the group chat ๐ญ
resolvconf solves this by letting the daemon send their resolv.conf(5) file to resolvconf via stdin(4) with the argument -a key instead of the filesystem. then resolvconf updates /etc/resolv.conf as it thinks best. no cap, it just handles it.
โ ๏ธ heads up: if/etc/resolv.confalready exists and the top line does not match the expected signature, thenresolvconfwill refuse to update it unless the-uupdate command is given. it's not being difficult, it's being safe ๐ซถ
when a local resolver other than libc is installed, such as dnsmasq(8) or named(8), then resolvconf will supply files that the resolver should be configured to include.
at it's heart, resolvconf is a key/value store for resolv.conf files. each entry must have a unique key and should be expressed as interface.protocol so that it's easy to tell from where the resolv.conf file came from. this also allows using pattern matching such as interface.* to match all protocols running on the interface. like, a modern system will likely run DHCP, RA and DHCPv6 which could be from separate programs or one program running many protocols โ the way that works is just chef's kiss. however, this is not a fixed requirement, resolvconf will work with any key name and it should be treated as an opaque value outside of resolvconf. iykyk.
resolvconf can mark a resolv.conf as private and optionally non-searchable. this means that the name servers listed in that resolv.conf are only used for queries against the domain/search listed in the same file โ and if non-searchable then the domain/search listed are excluded from the global search list defined in /etc/resolv.conf. this only works when a local resolver other than libc is installed. see resolvconf.conf(5) for how to configure resolvconf to use a local name server and how to remove the private marking.
resolvconf can also mark a resolv.conf as exclusive. only the latest exclusive key is used for processing, otherwise all are. main character energy, honestly ๐
when a configuration source goes away โ like an interface going down or a VPN stopping โ it should then call resolvconf with -d key arguments to clean up the resolv.conf it added previously. for systems that support the concept of persisting configuration when the source is suspended, such as the carrier going down, then it should instead call resolvconf with -C key arguments to deprecate the entry, and -c key to activate the entry when it comes back again. this only affects the order in which the resolv.conf entries are processed. it's a pause, not a breakup ๐โก๏ธ๐
here are some options for the above commands:
-fโ ignore non existentresolv.confentries. only really useful for deleting.-mmetric โ set the metric of theresolv.confentry when adding it, default of0. lower metrics take precedence. this affects the default order of entires when listed.-p[pattern] โ marks theresolv.confas private if the-acommand is given, otherwiseresolv.confentries having their key matching pattern are listed. if an extra-pis given then theresolv.confis marked as non-searchable as well. double-p, double the boundaries ๐ง-xโ mark theresolv.confas exclusive when adding, otherwise only use the latest exclusive key.
resolvconf has some more commands for general usage:
-i[pattern] โ list the keys stored, optionally matching pattern, we haveresolv.conffiles for. if the-Loption is given first, then the keys will be list post-processed.-L[pattern] โ list theresolv.conffiles we have, post-processed by theresolvconf.conf(5)configuration. if pattern is specified then we list the files for the keys which match it.-l[pattern] โ list theresolv.conffiles we have. if pattern is specified then we list the files for the keys which match it.-uโ forceresolvconfto update all its subscribers.resolvconfdoes not update the subscribers when adding aresolv.confthat matches what it already has for that key. like, why would it, nothing changed bestie ๐--versionโ echo theresolvconfversion to stdout.
resolvconf also has some commands designed to be used by its subscribers and system startup:
-Iโ initialise the state directory/run/resolvconf. this should be called after the base state directory has either been cleaned out or mounted as a memory backed filesystem during the initial boot sequence before any daemon has the chance to callresolvconf. first one in gets the aux ๐ง-Rโ echo the command used to restart a service.-rservice โ if the service is running then restart it. if the service does not exist or is not running then zero is returned, otherwise the result of restarting the service.-vโ echo variablesDOMAINS,SEARCHandNAMESERVERSso that the subscriber can configure the resolver easily.-Vโ same as-vexcept that only the information configured inresolvconf.conf(5)is set.
๐ RESOLV.CONF ORDERING ๐
for resolvconf to work effectively, it has to process the resolv.conf entries in the correct order. and the order is, in this exact sequence:
resolvconffirst processes keys from thekey_orderlist.- then entries without a metric and that match the
dynamic_orderlist. - then entries with a metric in order.
- and finally the rest in the operating systems lexical order.
see resolvconf.conf(5) for details on these lists. it's a whole lineup and everyone has their spot โจ
๐ง PROTOCOLS ๐ง
here are some suggested protocol tags to use for each resolv.conf:
dhcpโ Dynamic Host Configuration Protocol.pppโ Point-to-Point Protocol.raโ IPv6 Router Advertisement.dhcp6โ Dynamic Host Configuration Protocol, version 6.
๐ IMPLEMENTATION NOTES ๐
if a subscriber has the executable bit then it is executed โ otherwise it is assumed to be a shell script and sourced into the current environment in a subshell. this is done so that subscribers can remain fast, but are also not limited to the shell language. slay for flexibility ๐
portable subscribers should not use anything outside of /bin and /sbin because /usr and others may not be available when booting. also, it would be unwise to assume any shell specific features. ngl, keep it bare bones, that's the vibe check ๐ฉต
๐ ENVIRONMENT ๐
IF_METRICโ if the-moption is not present then we useIF_METRICfor the metric.IF_PRIVATEโ marks theresolv.confas private.IF_NOSEARCHโ marks theresolv.confas non-searchable.IF_EXCLUSIVEโ marks theresolv.confas exclusive.
๐ FILES ๐
/etc/resolv.conf.bakโ backup file of the originalresolv.conf./etc/resolvconf.confโ configuration file forresolvconf./usr/lib/resolvconfโ directory of subscribers which are run every timeresolvconfadds, deletes or updates./usr/lib/resolvconf/libc.dโ directory of subscribers which are run after the libc subscriber is run./run/resolvconfโ state directory forresolvconf.
โญ NOTES โญ
domain labels are assumed to be in ASCII and are converted to lower case to avoid duplicate zones when given differing case from different sources. lowercase everything, it's the law ๐ค
when running a local resolver other than libc, you will need to configure it to include files that resolvconf will generate. you should consult resolvconf.conf(5) for instructions on how to configure your resolver. go read it, bestie, it's important ๐
๐ธ SEE ALSO ๐ธ
resolver(3), stdin(4), resolv.conf(5), resolvconf.conf(5)
๐ HISTORY ๐
this implementation of resolvconf is called openresolv and is fully command line compatible with Debian's resolvconf, as written by Thomas Hood. heritage! lineage! iconic ๐
๐ซถ AUTHORS ๐ซถ
Roy Marples <roy@marples.name>
๐ BUGS ๐
please report them to http://roy.marples.name/projects/openresolv โ they genuinely want to hear it, no gatekeeping ๐ฅ
and that's the whole page, bestie โ this one came from Debian, dated June 26, 2025, filed under RESOLVCONF(8) in the System Manager's Manual โจ go forth and resolve some names ๐
๐ฆ where this page comes from
- alpine 3.23: openresolv-doc 3.17.4-r0 ยท BSD-2-Clause
- alpine 3.24: openresolv-doc 3.17.4-r0 ยท BSD-2-Clause
- arch rolling: openresolv 3.17.4-1 ยท BSD-2-Clause
- Copyright (c) 2007-2025 Roy Marples
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms