File: resolv_wrapper.1.adoc

package info (click to toggle)
resolv-wrapper 1.1.8-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 368 kB
  • sloc: ansic: 3,587; sh: 12; makefile: 7
file content (80 lines) | stat: -rw-r--r-- 2,385 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
resolv_wrapper(1)
=================
:author: The Samba Team
:revdate: 2020-01-31

NAME
----

resolv_wrapper - A wrapper for dns name resolving or dns faking.

SYNOPSIS
--------

LD_PRELOAD=libresolv_wrapper.so RESOLV_WRAPPER_CONF="/path/to/resolv.conf" *./myapplication*

DESCRIPTION
-----------

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't work on a special platform the wrapper is able to fake DNS queries
and return valid responses to your application.

- Redirects name queries to the nameservers specified in your resolv.conf
- Can fake DNS queries using a simple formatted DNS hosts file.

ENVIRONMENT VARIABLES
---------------------

*RESOLV_WRAPPER_CONF*::

This is used to specify the resolv.conf to use. The format of the resolv.conf
file is defined in the manpage 'resolv.conf(5)'. Currently only the *namserver*
directive is supported.

In order that this works with socket_wrapper. The res_* symbols need to be in
a separate libresolv library. If they are part of libc this wont work. This is
the case with glibc >= 2.34.

*RESOLV_WRAPPER_HOSTS*::

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:

    TYPE    RECORD_NAME RECORD_VALUE

For example:

    A       dc.cwrap.org 127.0.0.10
    AAAA    dc.cwrap.org fd00::5357:5f0a
    CNAME   kerberos.cwrap.org dc.cwrap.org
    SRV     _kerberos._tcp.cwrap.org kerberos.cwrap.org 88
    URI     _vpn.cwrap.org https://vpn.cwrap.org/VPN
    TXT     cwrap.org v=spf1 mx

*RESOLV_WRAPPER_DEBUGLEVEL*::

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.

- 0 = ERROR
- 1 = WARNING
- 2 = DEBUG
- 3 = TRACE

*RESOLV_WRAPPER_DISABLE_DEEPBIND*::

This allows you to disable deep binding in resolv_wrapper. This is useful for
running valgrind tools or sanitizers like (address, undefined, thread).

EXAMPLE
-------

The following command would trick 'kinit(1)' into using DNS servers from "./resolv.conf"
for Kerberos service resolution:

  $ LD_PRELOAD=libresolv_wrapper.so RESOLV_WRAPPER_CONF="./resolv.conf" kinit user@EXAMPLE.COM