Changeset View
Changeset View
Standalone View
Standalone View
resolvconf.8.in
| .\" Copyright (c) 2007-2016 Roy Marples | .\" Copyright (c) 2007-2025 Roy Marples | ||||
| .\" All rights reserved | .\" All rights reserved | ||||
| .\" | .\" | ||||
| .\" Redistribution and use in source and binary forms, with or without | .\" Redistribution and use in source and binary forms, with or without | ||||
| .\" modification, are permitted provided that the following conditions | .\" modification, are permitted provided that the following conditions | ||||
| .\" are met: | .\" are met: | ||||
| .\" 1. Redistributions of source code must retain the above copyright | .\" 1. Redistributions of source code must retain the above copyright | ||||
| .\" notice, this list of conditions and the following disclaimer. | .\" notice, this list of conditions and the following disclaimer. | ||||
| .\" 2. Redistributions in binary form must reproduce the above copyright | .\" 2. Redistributions in binary form must reproduce the above copyright | ||||
| .\" notice, this list of conditions and the following disclaimer in the | .\" notice, this list of conditions and the following disclaimer in the | ||||
| .\" documentation and/or other materials provided with the distribution. | .\" documentation and/or other materials provided with the distribution. | ||||
| .\" | .\" | ||||
| .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||||
| .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||||
| .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||||
| .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||||
| .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||||
| .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||||
| .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
| .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
| .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
| .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
| .\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
| .\" | .\" | ||||
| .Dd November 29, 2016 | .Dd June 26, 2025 | ||||
| .Dt RESOLVCONF 8 | .Dt RESOLVCONF 8 | ||||
| .Os | .Os | ||||
| .Sh NAME | .Sh NAME | ||||
| .Nm resolvconf | .Nm resolvconf | ||||
| .Nd a framework for managing multiple DNS configurations | .Nd a framework for managing multiple DNS configurations | ||||
| .Sh SYNOPSIS | .Sh SYNOPSIS | ||||
| .Nm | .Nm | ||||
| .Fl I | .Fl I | ||||
| .Nm | .Nm | ||||
| .Op Fl m Ar metric | .Op Fl m Ar metric | ||||
| .Op Fl p | .Op Fl p | ||||
| .Op Fl x | .Op Fl x | ||||
| .Fl a Ar interface Ns Op Ar .protocol | .Fl a Ar key | ||||
| .No < Ns Pa file | .No < Ns Pa file | ||||
| .Nm | .Nm | ||||
| .Fl C Ar pattern | |||||
| .Nm | |||||
| .Fl c Ar pattern | |||||
| .Nm | |||||
| .Op Fl f | .Op Fl f | ||||
| .Fl d Ar interface Ns Op Ar .protocol | .Fl d Ar key | ||||
| .Nm | .Nm | ||||
| .Op Fl x | .Op Fl x | ||||
| .Fl il Ar pattern | .Fl iLlp Ar pattern | ||||
| .Nm | .Nm | ||||
| .Fl u | .Fl u | ||||
| .Nm | .Nm | ||||
| .Fl Fl version | .Fl Fl version | ||||
| .Sh DESCRIPTION | .Sh DESCRIPTION | ||||
| .Nm | .Nm | ||||
| manages | manages | ||||
| .Xr resolv.conf 5 | .Xr resolv.conf 5 | ||||
| Show All 9 Lines | |||||
| .Nm | .Nm | ||||
| solves this by letting the daemon send their | solves this by letting the daemon send their | ||||
| .Xr resolv.conf 5 | .Xr resolv.conf 5 | ||||
| file to | file to | ||||
| .Nm | .Nm | ||||
| via | via | ||||
| .Xr stdin 4 | .Xr stdin 4 | ||||
| with the argument | with the argument | ||||
| .Fl a Ar interface Ns Op Ar .protocol | .Fl a Ar key | ||||
| instead of the filesystem. | instead of the filesystem. | ||||
| .Nm | .Nm | ||||
| then updates | then updates | ||||
| .Pa /etc/resolv.conf | .Pa /etc/resolv.conf | ||||
| as it thinks best. | as it thinks best. | ||||
| If | |||||
| .Pa /etc/resolv.conf | |||||
| already exists and the top line does not match the expected signature, | |||||
| then | |||||
| .Nm | |||||
| will refuse to update it unless the | |||||
| .Fl u | |||||
| update command is given. | |||||
| When a local resolver other than libc is installed, such as | When a local resolver other than libc is installed, such as | ||||
| .Xr dnsmasq 8 | .Xr dnsmasq 8 | ||||
| or | or | ||||
| .Xr named 8 , | .Xr named 8 , | ||||
| then | then | ||||
| .Nm | .Nm | ||||
| will supply files that the resolver should be configured to include. | will supply files that the resolver should be configured to include. | ||||
| .Pp | .Pp | ||||
| At it's heart, | |||||
| .Nm | .Nm | ||||
| assumes it has a job to do. | is a key/value store for | ||||
| In some situations | .Pa resolv.conf | ||||
| files. | |||||
| Each entry must have a unique | |||||
| .Ar key | |||||
| and should be expressed as | |||||
| .Sy interface.protocol | |||||
| so that it's easy to tell from where the | |||||
| .Pa resolv.conf | |||||
| file came from. | |||||
| This also allows using pattern matching such as | |||||
| .Sy interface.* | |||||
| to match all protocols running on the interface. | |||||
| For example, a modern system will likely run DHCP, RA and DHCPv6 | |||||
| which could be from separate programs or one program running | |||||
| many protocols. | |||||
| However, this is not a fixed requirement, | |||||
| .Nm | .Nm | ||||
| needs to act as a deterrent to writing to | will work with any key name and it should be treated as an opaque value | ||||
| .Pa /etc/resolv.conf . | outside of | ||||
| Where this file cannot be made immutable or you just need to toggle this | .Nm . | ||||
| behaviour, | |||||
| .Nm | |||||
| can be disabled by adding | |||||
| .Sy resolvconf Ns = Ns NO | |||||
| to | |||||
| .Xr resolvconf.conf 5 . | |||||
| .Pp | .Pp | ||||
| .Nm | .Nm | ||||
| can mark an interfaces | can mark a | ||||
| .Pa resolv.conf | .Pa resolv.conf | ||||
| as private. | as private and optionally non-searchable. | ||||
| This means that the name servers listed in that | This means that the name servers listed in that | ||||
| .Pa resolv.conf | .Pa resolv.conf | ||||
| are only used for queries against the domain/search listed in the same file. | 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 | |||||
| .Pa /etc/resolv.conf . | |||||
| This only works when a local resolver other than libc is installed. | This only works when a local resolver other than libc is installed. | ||||
| See | See | ||||
| .Xr resolvconf.conf 5 | .Xr resolvconf.conf 5 | ||||
| for how to configure | for how to configure | ||||
| .Nm | .Nm | ||||
| to use a local name server and how to remove the private marking. | to use a local name server and how to remove the private marking. | ||||
| .Pp | .Pp | ||||
| .Nm | .Nm | ||||
| can mark an interfaces | can mark a | ||||
| .Pa resolv.conf | .Pa resolv.conf | ||||
| as exclusive. | as exclusive. | ||||
| Only the latest exclusive interface is used for processing, otherwise all are. | Only the latest exclusive key is used for processing, otherwise all are. | ||||
| .Pp | .Pp | ||||
| When an interface goes down, it should then call | When a configuration source goes away, | ||||
| such as an interface going down or a VPN stopping, | |||||
| it should then call | |||||
| .Nm | .Nm | ||||
| with | with | ||||
| .Fl d Ar interface.* | .Fl d Ar key | ||||
| arguments to delete the | arguments to clean up the | ||||
| .Pa resolv.conf | .Pa resolv.conf | ||||
| file(s) for all the | it added previously. | ||||
| .Ar protocols | For systems that support the concept of persisting configuration when | ||||
| on the | the source is suspended, | ||||
| .Ar interface . | such as the carrier going down, | ||||
| then it should instead call | |||||
| .Nm | |||||
| with | |||||
| .Fl C Ar key | |||||
| arguments to deprecate the entry | |||||
| .Fl c Ar key | |||||
| to activate the entry when it comes back again. | |||||
| This only affects the order in which the | |||||
| .Pa resolv.conf | |||||
| entries are processed. | |||||
| .Pp | .Pp | ||||
| Here are some options for the above commands:- | Here are some options for the above commands: | ||||
| .Bl -tag -width pattern_opt | .Bl -tag -width pattern_opt | ||||
| .It Fl f | .It Fl f | ||||
| Ignore non existent interfaces. | Ignore non existent | ||||
| Only really useful for deleting interfaces. | .Pa resolv.conf | ||||
| entries. | |||||
| Only really useful for deleting. | |||||
| .It Fl m Ar metric | .It Fl m Ar metric | ||||
| Set the metric of the interface when adding it, default of 0. | Set the metric of the | ||||
| .Pa resolv.conf | |||||
| entry when adding it, default of 0. | |||||
| Lower metrics take precedence. | Lower metrics take precedence. | ||||
| This affects the default order of interfaces when listed. | This affects the default order of entires when listed. | ||||
| .It Fl p | .It Fl p Op Ar pattern | ||||
| Marks the interface | Marks the | ||||
| .Pa resolv.conf | .Pa resolv.conf | ||||
| as private. | as private if the | ||||
| .Fl a | |||||
| command is given, otherwise | |||||
| .Pa resolv.conf | |||||
| entries having their key matching | |||||
| .Ar pattern | |||||
| are listed. | |||||
| If an extra | |||||
| .Fl p | |||||
| is given then the | |||||
| .Pa resolv.conf | |||||
| is marked as non-searchable as well. | |||||
| .It Fl x | .It Fl x | ||||
| Mark the interface | Mark the | ||||
| .Pa resolv.conf | .Pa resolv.conf | ||||
| as exclusive when adding, otherwise only use the latest exclusive interface. | as exclusive when adding, otherwise only use the latest exclusive key. | ||||
| .El | .El | ||||
| .Pp | .Pp | ||||
| .Nm | .Nm | ||||
| has some more commands for general usage:- | has some more commands for general usage: | ||||
| .Bl -tag -width pattern_opt | .Bl -tag -width pattern_opt | ||||
| .It Fl i Ar pattern | .It Fl i Op Ar pattern | ||||
| List the interfaces and protocols, optionally matching | List the keys stored, optionally matching | ||||
| .Ar pattern , | .Ar pattern , | ||||
| we have | we have | ||||
| .Pa resolv.conf | .Pa resolv.conf | ||||
| files for. | files for. | ||||
| .It Fl l Ar pattern | If the | ||||
| .Fl L | |||||
| option is given first, then the keys will be list post-processed. | |||||
| .It Fl L Op Ar pattern | |||||
| List the | List the | ||||
| .Pa resolv.conf | .Pa resolv.conf | ||||
| files we have, | |||||
| post-processed by the | |||||
| .Xr resolvconf.conf 5 | |||||
| configuration. | |||||
| If | |||||
| .Ar pattern | |||||
| is specified then we list the files for the keys which match it. | |||||
| .It Fl l Op Ar pattern | |||||
| List the | |||||
| .Pa resolv.conf | |||||
| files we have. | files we have. | ||||
| If | If | ||||
| .Ar pattern | .Ar pattern | ||||
| is specified then we list the files for the interfaces and protocols | is specified then we list the files for the keys which match it. | ||||
| that match it. | that match it. | ||||
| .It Fl u | .It Fl u | ||||
| Force | Force | ||||
| .Nm | .Nm | ||||
| to update all its subscribers. | to update all its subscribers. | ||||
| .Nm | .Nm | ||||
| does not update the subscribers when adding a resolv.conf that matches | does not update the subscribers when adding a resolv.conf that matches | ||||
| what it already has for that interface. | what it already has for that key. | ||||
| .It Fl Fl version | .It Fl Fl version | ||||
| Echo the resolvconf version to | Echo the resolvconf version to | ||||
| .Em stdout . | .Em stdout . | ||||
| .El | .El | ||||
| .Pp | .Pp | ||||
| .Nm | .Nm | ||||
| also has some commands designed to be used by it's subscribers and | also has some commands designed to be used by its subscribers and | ||||
| system startup:- | system startup: | ||||
| .Bl -tag -width pattern_opt | .Bl -tag -width pattern_opt | ||||
| .It Fl I | .It Fl I | ||||
| Initialise the state directory | Initialise the state directory | ||||
| .Pa @VARDIR@ . | .Pa @VARDIR@ . | ||||
| This only needs to be called if the initial system boot sequence does not | This should be called after the base state directory has either been | ||||
| automatically clean it out; for example the state directory is moved | cleaned out or mounted as a memory backed filesystem during the | ||||
| somewhere other than | initial boot sequence before any daemon has the chance to call | ||||
| .Pa /var/run . | .Nm . | ||||
| If used, it should only be called once as early in the system boot sequence | |||||
| as possible and before | |||||
| .Nm | |||||
| is used to add interfaces. | |||||
| .It Fl R | .It Fl R | ||||
| Echo the command used to restart a service. | Echo the command used to restart a service. | ||||
| .It Fl r Ar service | .It Fl r Ar service | ||||
| If the | If the | ||||
| .Ar service | .Ar service | ||||
| is running then restart it. | is running then restart it. | ||||
| If the service does not exist or is not running then zero is returned, | If the service does not exist or is not running then zero is returned, | ||||
| otherwise the result of restarting the service. | otherwise the result of restarting the service. | ||||
| .It Fl v | .It Fl v | ||||
| Echo variables DOMAINS, SEARCH and NAMESERVERS so that the subscriber can | Echo variables DOMAINS, SEARCH and NAMESERVERS so that the subscriber can | ||||
| configure the resolver easily. | configure the resolver easily. | ||||
| .It Fl V | .It Fl V | ||||
| Same as | Same as | ||||
| .Fl v | .Fl v | ||||
| except that only the information configured in | except that only the information configured in | ||||
| .Xr resolvconf.conf 5 | .Xr resolvconf.conf 5 | ||||
| is set. | is set. | ||||
| .El | .El | ||||
| .Sh INTERFACE ORDERING | .Sh RESOLV.CONF ORDERING | ||||
| For | For | ||||
| .Nm | .Nm | ||||
| to work effectively, it has to process the resolv.confs for the interfaces | to work effectively, it has to process the | ||||
| in the correct order. | .Pa resolv.conf | ||||
| entries in the correct order. | |||||
| .Nm | .Nm | ||||
| first processes interfaces from the | first processes keys from the | ||||
| .Sy interface_order | .Sy key_order | ||||
| list, then interfaces without a metic and that match the | list, then entries without a metric and that match the | ||||
| .Sy dynamic_order | .Sy dynamic_order | ||||
| list, then interfaces with a metric in order and finally the rest in | list, then entries with a metric in order and finally the rest in | ||||
| the operating systems lexical order. | the operating systems lexical order. | ||||
| See | See | ||||
| .Xr resolvconf.conf 5 | .Xr resolvconf.conf 5 | ||||
| for details on these lists. | for details on these lists. | ||||
| .Sh PROTOCOLS | .Sh PROTOCOLS | ||||
| Here are some suggested protocol tags to use for each | Here are some suggested protocol tags to use for each | ||||
| .Pa resolv.conf | .Pa resolv.conf | ||||
| file registered on an | |||||
| .Ar interface Ns No :- | |||||
| .Bl -tag -width pattern_opt | .Bl -tag -width pattern_opt | ||||
| .It dhcp | .It dhcp | ||||
| Dynamic Host Configuration Protocol. | Dynamic Host Configuration Protocol. | ||||
| Initial versions of | |||||
| .Nm | |||||
| did not recommend a | |||||
| .Ar protocol | |||||
| tag be appended to the | |||||
| .Ar interface | |||||
| name. | |||||
| When the protocol is absent, it is assumed to be the DHCP protocol. | |||||
| .It ppp | .It ppp | ||||
| Point-to-Point Protocol. | Point-to-Point Protocol. | ||||
| .It ra | .It ra | ||||
| IPv6 Router Advertisement. | IPv6 Router Advertisement. | ||||
| .It dhcp6 | .It dhcp6 | ||||
| Dynamic Host Configuration Protocol, version 6. | Dynamic Host Configuration Protocol, version 6. | ||||
| .El | .El | ||||
| .Sh IMPLEMENTATION NOTES | .Sh IMPLEMENTATION NOTES | ||||
| Show All 15 Lines | |||||
| .Bl -ohang | .Bl -ohang | ||||
| .It Va IF_METRIC | .It Va IF_METRIC | ||||
| If the | If the | ||||
| .Fl m | .Fl m | ||||
| option is not present then we use | option is not present then we use | ||||
| .Va IF_METRIC | .Va IF_METRIC | ||||
| for the metric. | for the metric. | ||||
| .It Va IF_PRIVATE | .It Va IF_PRIVATE | ||||
| Marks the interface | Marks the | ||||
| .Pa resolv.conf | .Pa resolv.conf | ||||
| as private. | as private. | ||||
| .It Va IF_NOSEARCH | |||||
| Marks the | |||||
| .Pa resolv.conf | |||||
| as non-searchable. | |||||
| .It Va IF_EXCLUSIVE | .It Va IF_EXCLUSIVE | ||||
| Marks the interface | Marks the | ||||
| .Pa resolv.conf | .Pa resolv.conf | ||||
| as exclusive. | as exclusive. | ||||
| .El | .El | ||||
| .Sh FILES | .Sh FILES | ||||
| .Bl -ohang | .Bl -ohang | ||||
| .It Pa /etc/resolv.conf.bak | .It Pa /etc/resolv.conf.bak | ||||
| Backup file of the original resolv.conf. | Backup file of the original resolv.conf. | ||||
| .It Pa @SYSCONFDIR@/resolvconf.conf | .It Pa @SYSCONFDIR@/resolvconf.conf | ||||
| Configuration file for | Configuration file for | ||||
| .Nm . | .Nm . | ||||
| .It Pa @LIBEXECDIR@ | .It Pa @LIBEXECDIR@ | ||||
| Directory of subscribers which are run every time | Directory of subscribers which are run every time | ||||
| .Nm | .Nm | ||||
| adds, deletes or updates. | adds, deletes or updates. | ||||
| .It Pa @LIBEXECDIR@/libc.d | .It Pa @LIBEXECDIR@/libc.d | ||||
| Directory of subscribers which are run after the libc subscriber is run. | Directory of subscribers which are run after the libc subscriber is run. | ||||
| .It Pa @VARDIR@ | .It Pa @VARDIR@ | ||||
| State directory for | State directory for | ||||
| .Nm . | .Nm . | ||||
| .El | .El | ||||
| .Sh 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. | |||||
| .Pp | |||||
| When running a local resolver other than libc, you will need to configure it | |||||
| to include files that | |||||
| .Nm | |||||
| will generate. | |||||
| You should consult | |||||
| .Xr resolvconf.conf 5 | |||||
| for instructions on how to configure your resolver. | |||||
| .Sh SEE ALSO | .Sh SEE ALSO | ||||
| .Xr resolver 3 , | .Xr resolver 3 , | ||||
| .Xr stdin 4 , | .Xr stdin 4 , | ||||
| .Xr resolv.conf 5 , | .Xr resolv.conf 5 , | ||||
| .Xr resolvconf.conf 5 | .Xr resolvconf.conf 5 | ||||
| .Sh HISTORY | .Sh HISTORY | ||||
| This implementation of | This implementation of | ||||
| .Nm | .Nm | ||||
| is called openresolv and is fully command line compatible with Debian's | is called openresolv and is fully command line compatible with Debian's | ||||
| resolvconf, as written by Thomas Hood. | resolvconf, as written by Thomas Hood. | ||||
| .Sh AUTHORS | .Sh AUTHORS | ||||
| .An Roy Marples Aq Mt roy@marples.name | .An Roy Marples Aq Mt roy@marples.name | ||||
| .Sh BUGS | .Sh BUGS | ||||
| Please report them to | Please report them to | ||||
| .Lk http://roy.marples.name/projects/openresolv | .Lk http://roy.marples.name/projects/openresolv | ||||
| .Pp | |||||
| .Nm | |||||
| does not validate any of the files given to it. | |||||
| .Pp | |||||
| When running a local resolver other than libc, you will need to configure it | |||||
| to include files that | |||||
| .Nm | |||||
| will generate. | |||||
| You should consult | |||||
| .Xr resolvconf.conf 5 | |||||
| for instructions on how to configure your resolver. | |||||