dcd161d9168f44a348f9509fe70c23384067a820
[resolv_wrapper.git] / doc / resolv_wrapper.1.txt
1 resolv_wrapper(1)
2 =================
3 :revdate: 2019-01-04
4
5 NAME
6 ----
7
8 resolv_wrapper - A wrapper for dns name resolving or dns faking.
9
10 SYNOPSIS
11 --------
12
13 LD_PRELOAD=libresolv_wrapper.so RESOLV_WRAPPER_CONF="/path/to/resolv.conf" *./myapplication*
14
15 DESCRIPTION
16 -----------
17
18 resolv_wrapper makes it possible on most UNIX platforms to contact your own DNS
19 implementation in your test environment. It requires socket_wrapper to be able
20 to contact it.
21 If it doesn't work on a special platform the wrapper is able to fake DNS queries
22 and return valid responses to your application.
23
24 - Redirects name queries to the nameservers specified in your resolv.conf
25 - Can fake DNS queries using a simple formatted DNS hosts file.
26
27 ENVIRONMENT VARIABLES
28 ---------------------
29
30 *RESOLV_WRAPPER_CONF*::
31
32 This is used to specify the resolv.conf to use. The format of the resolv.conf
33 file is defined in the manpage 'resolv.conf(5)'. Currently only the *namserver*
34 directive is supported.
35
36 *RESOLV_WRAPPER_HOSTS*::
37
38 This environment variable is used for faking DNS queries. It must point to a
39 hosts-like text file that specifies fake records for custom queries. The
40 format of the file looks like this:
41
42     TYPE    RECORD_NAME RECORD_VALUE
43
44 For example:
45
46     A       dc.cwrap.org 127.0.0.10
47     AAAA    dc.cwrap.org fd00::5357:5f0a
48     CNAME   kerberos.cwrap.org dc.cwrap.org
49     SRV     _kerberos._tcp.cwrap.org kerberos.cwrap.org 88
50     URI     _vpn.cwrap.org https://vpn.cwrap.org/VPN
51     TXT     cwrap.org v=spf1 mx
52
53 *RESOLV_WRAPPER_DEBUGLEVEL*::
54
55 If you need to see what is going on in resolv_wrapper itself or try to find a
56 bug, you can enable logging support in resolv_wrapper if you built it with
57 debug symbols.
58
59 - 0 = ERROR
60 - 1 = WARNING
61 - 2 = DEBUG
62 - 3 = TRACE
63
64 *RESOLV_WRAPPER_DISABLE_DEEPBIND*::
65
66 This allows you to disable deep binding in resolv_wrapper. This is useful for
67 running valgrind tools or sanitizers like (address, undefined, thread).
68
69 EXAMPLE
70 -------
71
72 The following command would trick 'kinit(1)' into using DNS servers from "./resolv.conf"
73 for Kerberos service resolution:
74
75   $ LD_PRELOAD=libresolv_wrapper.so RESOLV_WRAPPER_CONF="./resolv.conf" kinit user@EXAMPLE.COM