RESOLV_WRAPPER(1)
π RESOLV_WRAPPER π
okay bestie, gather round, because this is the resolv_wrapper(1) manual page and it is lowkey a whole vibe. it's a wrapper for dns name resolving or dns faking, and yes, both of those things are as iconic as they sound. π¦
β¨ SYNOPSIS β¨
LD_PRELOAD=libresolv_wrapper.so
RESOLV_WRAPPER_CONF="/path/to/resolv.conf" ./myapplication
πΈ DESCRIPTION πΈ
so here's the tea π«: resolv_wrapper makes it possible, on most UNIX platforms, to contact your own DNS implementation inside your test environment. that's the dream, right? it does require socket_wrapper to be able to contact it though β no socket_wrapper, no party. π
and if it just doesn't work on some special platform? no worries bestie, the wrapper is able to fake DNS queries and return valid responses to your application. main character energy: it adapts. π
- 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 how you specify whichresolv.confto use. the format of theresolv.conffile is defined in the manpageresolv.conf(5). rn, only thenamserverdirective is supported β that's it, that's the whole menu, periodt.
so that this works with socket_wrapper, the res_* symbols need to be in a separate libresolv library. if they're part of libc this wont work. and this is literally the case with glibc >= 2.34. π
RESOLV_WRAPPER_HOSTSβ this env var is the one you use 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
look at that. immaculate. π₯
RESOLV_WRAPPER_DEBUGLEVELβ if you need to see what is going on inresolv_wrapperitself, or you're trying to find a bug, you can enable logging support inresolv_wrapperif you built it with debug symbols. iykyk. π§0= ERROR1= WARNING2= DEBUG3= TRACE
RESOLV_WRAPPER_DISABLE_DEEPBINDβ this lets you disable deep binding inresolv_wrapper. super useful for running valgrind tools or sanitizers like (address, undefined, thread). slay. β
π 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
not me gaslighting kinit into using a different resolv.conf. it's giving chaos, but make it DNS. π
π AUTHOR π
The Samba Team
and that's the whole page, bestie!! this was RESOLV_WRAPPER(1) from 2021-11-03, brought to you by the lovely humans who ship the resolv_wrapper manual. mwah π go forth and resolve (or fake) responsibly, ily π«Ά
π¦ where this page comes from
- fedora 43: resolv_wrapper 1.1.8-10.fc43 Β· BSD-3-Clause
- fedora 43: resolv_wrapper 1.1.8-10.fc43 Β· BSD-3-Clause
- fedora 44: resolv_wrapper 1.1.8-11.fc44 Β· BSD-3-Clause
- fedora 44: resolv_wrapper 1.1.8-11.fc44 Β· BSD-3-Clause
- nixos 26.05: resolv_wrapper 1.1.8
- nixpkgs unstable: resolv_wrapper 1.1.8
- opensuse-leap 16.0: resolv_wrapper 1.1.8-bp160.1.11 Β· BSD-3-Clause
- opensuse-leap 16.0: resolv_wrapper 1.1.8-bp160.1.11 Β· BSD-3-Clause
- opensuse-leap 16.0: resolv_wrapper 1.1.8-bp160.1.11 Β· BSD-3-Clause
- opensuse-leap 16.0: resolv_wrapper 1.1.8-bp160.1.11 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms