2 .\" Title: resolv_wrapper
3 .\" Author: The Samba Team
4 .\" Generator: Asciidoctor 2.0.15
10 .TH "RESOLV_WRAPPER" "1" "2021-11-03" "\ \&" "\ \&"
28 . LINKSTYLE blue R < >
31 resolv_wrapper \- A wrapper for dns name resolving or dns faking.
34 LD_PRELOAD=libresolv_wrapper.so RESOLV_WRAPPER_CONF="/path/to/resolv.conf" \fB./myapplication\fP
37 resolv_wrapper makes it possible on most UNIX platforms to contact your own DNS
38 implementation in your test environment. It requires socket_wrapper to be able
40 If it doesn\(cqt work on a special platform the wrapper is able to fake DNS queries
41 and return valid responses to your application.
51 Redirects name queries to the nameservers specified in your resolv.conf
62 Can fake DNS queries using a simple formatted DNS hosts file.
64 .SH "ENVIRONMENT VARIABLES"
66 \fBRESOLV_WRAPPER_CONF\fP
68 This is used to specify the resolv.conf to use. The format of the resolv.conf
69 file is defined in the manpage \fIresolv.conf(5)\fP. Currently only the \fBnamserver\fP
70 directive is supported.
73 In order that this works with socket_wrapper. The res_* symbols need to be in
74 a separate libresolv library. If they are part of libc this wont work. This is
75 the case with glibc >= 2.34.
77 \fBRESOLV_WRAPPER_HOSTS\fP
79 This environment variable is used for faking DNS queries. It must point to a
80 hosts\-like text file that specifies fake records for custom queries. The
81 format of the file looks like this:
86 TYPE RECORD_NAME RECORD_VALUE
97 A dc.cwrap.org 127.0.0.10
98 AAAA dc.cwrap.org fd00::5357:5f0a
99 CNAME kerberos.cwrap.org dc.cwrap.org
100 SRV _kerberos._tcp.cwrap.org kerberos.cwrap.org 88
101 URI _vpn.cwrap.org https://vpn.cwrap.org/VPN
102 TXT cwrap.org v=spf1 mx
107 \fBRESOLV_WRAPPER_DEBUGLEVEL\fP
109 If you need to see what is going on in resolv_wrapper itself or try to find a
110 bug, you can enable logging support in resolv_wrapper if you built it with
158 \fBRESOLV_WRAPPER_DISABLE_DEEPBIND\fP
160 This allows you to disable deep binding in resolv_wrapper. This is useful for
161 running valgrind tools or sanitizers like (address, undefined, thread).
165 The following command would trick \fIkinit(1)\fP into using DNS servers from "./resolv.conf"
166 for Kerberos service resolution:
171 $ LD_PRELOAD=libresolv_wrapper.so RESOLV_WRAPPER_CONF="./resolv.conf" kinit user@EXAMPLE.COM