52197135d15a73d84e278f9425976f37ccf81747
[obnox/cwrap/resolv_wrapper.git] / doc / resolv_wrapper.1
1 '\" t
2 .\"     Title: resolv_wrapper
3 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
5 .\"      Date: 2015-08-18
6 .\"    Manual: \ \&
7 .\"    Source: \ \&
8 .\"  Language: English
9 .\"
10 .TH "RESOLV_WRAPPER" "1" "2015\-08\-18" "\ \&" "\ \&"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 resolv_wrapper \- A wrapper for dns name resolving or dns faking\&.
32 .SH "SYNOPSIS"
33 .sp
34 LD_PRELOAD=libresolv_wrapper\&.so RESOLV_WRAPPER_CONF="/path/to/resolv\&.conf" \fB\&./myapplication\fR
35 .SH "DESCRIPTION"
36 .sp
37 resolv_wrapper makes it possible on most UNIX platforms to contact your own DNS implementation in your test environment\&. It requires socket_wrapper to be able to contact it\&. If it doesn\(cqt work on a special platform the wrapper is able to fake DNS queries and return valid responses to your application\&.
38 .sp
39 .RS 4
40 .ie n \{\
41 \h'-04'\(bu\h'+03'\c
42 .\}
43 .el \{\
44 .sp -1
45 .IP \(bu 2.3
46 .\}
47 Redirects name queries to the nameservers specified in your resolv\&.conf
48 .RE
49 .sp
50 .RS 4
51 .ie n \{\
52 \h'-04'\(bu\h'+03'\c
53 .\}
54 .el \{\
55 .sp -1
56 .IP \(bu 2.3
57 .\}
58 Can fake DNS queries using a simple formatted DNS hosts file\&.
59 .RE
60 .SH "ENVIRONMENT VARIABLES"
61 .PP
62 \fBRESOLV_WRAPPER_CONF\fR
63 .RS 4
64 This is used to specify the resolv\&.conf to use\&. The format of the resolv\&.conf file is defined in the manpage
65 \fIresolv\&.conf(5)\fR\&. Currently only the
66 \fBnamserver\fR
67 directive is supported\&.
68 .RE
69 .PP
70 \fBRESOLV_WRAPPER_HOSTS\fR
71 .RS 4
72 This environment variable is used for faking DNS queries\&. It must point to a hosts\-like text file that specifies fake records for custom queries\&. The format of the file looks like this:
73 .sp
74 .if n \{\
75 .RS 4
76 .\}
77 .nf
78 TYPE    RECORD_NAME RECORD_VALUE
79 .fi
80 .if n \{\
81 .RE
82 .\}
83 .RE
84 .sp
85 For example:
86 .sp
87 .if n \{\
88 .RS 4
89 .\}
90 .nf
91 A       dc\&.cwrap\&.org 127\&.0\&.0\&.10
92 AAAA    dc\&.cwrap\&.org fd00::5357:5f0a
93 CNAME   kerberos\&.cwrap\&.org dc\&.cwrap\&.org
94 SRV     _kerberos\&._tcp\&.cwrap\&.org kerberos\&.cwrap\&.org 88
95 .fi
96 .if n \{\
97 .RE
98 .\}
99 .PP
100 \fBRESOLV_WRAPPER_DEBUGLEVEL\fR
101 .RS 4
102 If you need to see what is going on in resolv_wrapper itself or try to find a bug, you can enable logging support in resolv_wrapper if you built it with debug symbols\&.
103 .sp
104 .RS 4
105 .ie n \{\
106 \h'-04'\(bu\h'+03'\c
107 .\}
108 .el \{\
109 .sp -1
110 .IP \(bu 2.3
111 .\}
112 0 = ERROR
113 .RE
114 .sp
115 .RS 4
116 .ie n \{\
117 \h'-04'\(bu\h'+03'\c
118 .\}
119 .el \{\
120 .sp -1
121 .IP \(bu 2.3
122 .\}
123 1 = WARNING
124 .RE
125 .sp
126 .RS 4
127 .ie n \{\
128 \h'-04'\(bu\h'+03'\c
129 .\}
130 .el \{\
131 .sp -1
132 .IP \(bu 2.3
133 .\}
134 2 = DEBUG
135 .RE
136 .sp
137 .RS 4
138 .ie n \{\
139 \h'-04'\(bu\h'+03'\c
140 .\}
141 .el \{\
142 .sp -1
143 .IP \(bu 2.3
144 .\}
145 3 = TRACE
146 .RE
147 .RE
148 .SH "EXAMPLE"
149 .sp
150 The following command would trick \fIkinit(1)\fR into using DNS servers from "\&./resolv\&.conf" for Kerberos service resolution:
151 .sp
152 .if n \{\
153 .RS 4
154 .\}
155 .nf
156 $ LD_PRELOAD=libresolv_wrapper\&.so RESOLV_WRAPPER_CONF="\&./resolv\&.conf" kinit user@EXAMPLE\&.COM
157 .fi
158 .if n \{\
159 .RE
160 .\}