1*a95f0396Skirill.\" $OpenBSD: unwind.conf.5,v 1.35 2024/11/24 11:33:34 kirill Exp $ 2018cebfbSflorian.\" 3018cebfbSflorian.\" Copyright (c) 2018 Florian Obser <florian@openbsd.org> 4018cebfbSflorian.\" Copyright (c) 2005 Esben Norby <norby@openbsd.org> 5018cebfbSflorian.\" Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org> 6018cebfbSflorian.\" Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> 7018cebfbSflorian.\" Copyright (c) 2002 Daniel Hartmeier <dhartmei@openbsd.org> 8018cebfbSflorian.\" 9018cebfbSflorian.\" Permission to use, copy, modify, and distribute this software for any 10018cebfbSflorian.\" purpose with or without fee is hereby granted, provided that the above 11018cebfbSflorian.\" copyright notice and this permission notice appear in all copies. 12018cebfbSflorian.\" 13018cebfbSflorian.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 14018cebfbSflorian.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 15018cebfbSflorian.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 16018cebfbSflorian.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 17018cebfbSflorian.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 18018cebfbSflorian.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 19018cebfbSflorian.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 20018cebfbSflorian.\" 21*a95f0396Skirill.Dd $Mdocdate: November 24 2024 $ 22018cebfbSflorian.Dt UNWIND.CONF 5 23018cebfbSflorian.Os 24018cebfbSflorian.Sh NAME 25018cebfbSflorian.Nm unwind.conf 26018cebfbSflorian.Nd validating DNS resolver configuration file 27018cebfbSflorian.Sh DESCRIPTION 28018cebfbSflorianThe 29018cebfbSflorian.Xr unwind 8 30018cebfbSfloriandaemon is a validating DNS resolver. 31018cebfbSflorian.Pp 32018cebfbSflorianThe 33018cebfbSflorian.Nm 34018cebfbSflorianconfig file is divided into the following main sections: 35018cebfbSflorian.Bl -tag -width xxxx 36018cebfbSflorian.It Sy Macros 37018cebfbSflorianUser-defined variables may be defined and used later, simplifying the 38018cebfbSflorianconfiguration file. 39018cebfbSflorian.It Sy Global Configuration 40018cebfbSflorianGlobal settings for 41018cebfbSflorian.Xr unwind 8 . 42018cebfbSflorian.El 43018cebfbSflorian.Pp 44018cebfbSflorianAdditional configuration files can be included with the 45018cebfbSflorian.Ic include 46018cebfbSfloriankeyword. 47018cebfbSflorian.Sh MACROS 48018cebfbSflorianMacros can be defined that will later be expanded in context. 49018cebfbSflorianMacro names must start with a letter, digit, or underscore, 50018cebfbSflorianand may contain any of those characters. 511b744e65SflorianMacro names may not be reserved words (for example, 521b744e65Sflorian.Ic forwarder , 531b744e65Sflorian.Ic port , 541b744e65Sflorianor 55ddb9081dSjmc.Ic DoT ) . 56018cebfbSflorianMacros are not expanded inside quotes. 571b744e65Sflorian.Pp 581b744e65SflorianFor example: 591b744e65Sflorian.Bd -literal -offset indent 601b744e65Sflorianfwd1=192.0.2.53 611b744e65Sflorianfwd2=192.0.2.153 621b744e65Sflorianforwarder { $fwd1 $fwd2 } 631b744e65Sflorian.Ed 64018cebfbSflorian.Sh GLOBAL CONFIGURATION 65018cebfbSflorian.Bl -tag -width Ds 66ac71ec8eSflorian.It Ic block list Ar file Op Cm log 672d988276SflorianA file containing domains to block, one per line. 6841ce3b17SnaddyIf a domain from this list is queried, 692d988276Sflorian.Nm unwind 702d988276Sfloriananswers with a return code of 718ec849bcSkn.Dv REFUSED . 72ac71ec8eSflorianWith 73ac71ec8eSflorian.Cm log 74ac71ec8eSflorianblocked queries are logged. 75*a95f0396SkirillThe list supports limited wildcard syntax: domains starting with . (dot) 76*a95f0396Skirillare treated as any subdomains on that zone. 773461bfbeSflorian.It Ic forwarder Brq Ar address Oo Ic port Ar number Oc Oo Oo Ic authentication name Ar name Oc Ic DoT Oc ... 788bb1780bSjmcA list of addresses of DNS name servers to forward queries to. 79da613dcdSflorian.Ic port 80da613dcdSfloriandefaults to 53. 813570995aSflorianIf 823570995aSflorian.Ic DoT 838bb1780bSjmcis specified, use DNS over TLS when sending queries to the server at 843570995aSflorian.Ar address . 85da613dcdSflorianThe default 86da613dcdSflorian.Ic port 87da613dcdSflorianis 853. 883461bfbeSflorian.Ar name 893461bfbeSflorianvalidates the certificate of the DNS over TLS server. 90fd873f7fSflorian.It Ic preference Brq Ar type ... 9110a0749eSottoA list of DNS name server types to specify the order in which 9210a0749eSottoname servers are picked when measured round-trip time medians are equal. 9310a0749eSottoAdditionally, the first mentioned type gets a time bonus. 94fd873f7fSflorianValidating name servers are always picked over non-validating name servers. 95f5291493SjmcDNS name server types are, 96f5291493Sjmcin default order of preference: 97f5291493Sjmc.Bl -tag -width "oDoT-forwarder" 98fd873f7fSflorian.It Ic DoT 99fd873f7fSflorianDNS over TLS name servers configured in 1005bc82f07Sjmc.Nm . 10115fe126bSflorian.It Ic oDoT-forwarder 10215fe126bSflorianName servers configured in 10315fe126bSflorian.Nm . 10415fe126bSflorian.Nm unwind 10515fe126bSfloriantries to opportunistically use DNS over TLS. 106f5291493Sjmc.It Ic forwarder 107f5291493SjmcName servers configured in 108f5291493Sjmc.Nm . 109fd873f7fSflorian.It Ic recursor 110fd873f7fSflorian.Nm unwind 111fd873f7fSflorianitself recursively resolves names. 112f5291493Sjmc.It Ic oDoT-autoconf 113f5291493SjmcName servers learned from autoconfiguration. 114f5291493SjmcA list of sources for proposals learned through autoconfiguration 115f5291493Sjmcis documented in 116f5291493Sjmc.Xr resolvd 8 . 117f5291493Sjmc.Nm unwind 118f5291493Sjmctries to opportunistically use DNS over TLS. 119f5291493Sjmc.It Ic autoconf 120f5291493SjmcName servers learned from autoconfiguration. 121f5291493Sjmc.It Ic stub 122f5291493SjmcName servers learned from autoconfiguration, 123f5291493Sjmcqueried using the libc functions 124f5291493Sjmc(see 125f5291493Sjmc.Xr asr_run 3 ) . 126f5291493SjmcWill never validate. 127f5291493SjmcUseful when running behind broken middle boxes that do not like edns0. 128f5291493SjmcDNS answers from stub name servers are not cached. 129fd873f7fSflorian.El 130dd16127bSotto.It Ic force Oo Cm accept bogus Oc Ar type Brq Ar name ... 131dd16127bSottoForce resolving of 132dd16127bSotto.Ar name 133dd16127bSottoand its subdomains by the given resolver 134dd16127bSotto.Ar type . 1359518e4dbSflorianThe 1369518e4dbSflorian.Ar type 1379518e4dbSflorianmust be listed in the 1389518e4dbSflorian.Ic preference 1399518e4dbSflorianlist to be used. 140dd16127bSottoIf 141dd16127bSotto.Cm accept bogus 14241ce3b17Snaddyis specified, validation is not enforced. 143b2501eadSflorian.El 144018cebfbSflorian.Sh FILES 145ccdd1482Sotto.Bl -tag -width "/etc/unwind.conf" -compact 146018cebfbSflorian.It Pa /etc/unwind.conf 1478bb1780bSjmcThe default 148018cebfbSflorian.Xr unwind 8 1498bb1780bSjmcconfiguration file. 150018cebfbSflorian.El 151f298f012Ssolene.Sh EXAMPLES 1528ec849bcSknBlock requests for domains in 153f298f012Ssolene.Pa /etc/blocklist 154f298f012Ssoleneand log each blocked request: 155f298f012Ssolene.Bd -literal -offset indent 156f298f012Ssoleneblock list "/etc/blocklist" log 157f298f012Ssolene.Ed 158f298f012Ssolene.Pp 159f298f012SsoleneDefine a DNS over TLS (DoT) forwarder and make it the preferred resolver: 160f298f012Ssolene.Bd -literal -offset indent 161ba90635cSknforwarder { 192.168.1.250 port 8080 authentication name "resolver.local" DoT } 162ba90635cSknpreference { DoT } 163f298f012Ssolene.Ed 164f298f012Ssolene.Pp 165f298f012SsoleneWhere a domain requires a specific nameserver 166f298f012Ssoleneand it may only exist in a nameserver available on the local network, 167f298f012Ssoleneforce 168f298f012Ssolene.Xr unwind 8 169f298f012Ssoleneto use a specific resolver type: 170f298f012Ssolene.Bd -literal -offset indent 17156fed3e1Sknforce autoconf { domain.local } 172f298f012Ssolene.Ed 173018cebfbSflorian.Sh SEE ALSO 174018cebfbSflorian.Xr rc.conf.local 8 , 175018cebfbSflorian.Xr unwind 8 , 176018cebfbSflorian.Xr unwindctl 8 177018cebfbSflorian.Sh HISTORY 178018cebfbSflorianThe 179018cebfbSflorian.Nm 180018cebfbSflorianfile format first appeared in 181018cebfbSflorian.Ox 6.5 . 182