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