RESOLV\_WRAPPER(1)   RESOLV\_WRAPPER(1)

# [NAME](#NAME)

resolv\_wrapper - A wrapper for dns name resolving or dns faking.

# [SYNOPSIS](#SYNOPSIS)

LD\_PRELOAD=libresolv\_wrapper.so RESOLV\_WRAPPER\_CONF="/path/to/resolv.conf" **./myapplication**

# [DESCRIPTION](#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](#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)*](/man/os/resolv_wrapper/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 &gt;= 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](#EXAMPLE)

The following command would trick [*kinit(1)*](/man/os/resolv_wrapper/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
```

# [AUTHOR](#AUTHOR)

The Samba Team

2021-11-03

---

Document: resolv_wrapper(1) from resolv_wrapper 1.1.8-r3 (Chainguard OS)
Source: https://git.samba.org/resolv_wrapper.git
