From 90cc3a6e745340b195aae4283a66adc891d6a071 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 12 Oct 2014 20:04:11 +0200 Subject: [PATCH] doc: Add section for dns faking to manpage. Signed-off-by: Andreas Schneider Reviewed-by: Michael Adam --- doc/resolv_wrapper.1 | 45 ++++++++++++++++++++++++++++++++++++++-- doc/resolv_wrapper.1.txt | 29 +++++++++++++++++--------- 2 files changed, 62 insertions(+), 12 deletions(-) diff --git a/doc/resolv_wrapper.1 b/doc/resolv_wrapper.1 index 911f4b4..5482b3d 100644 --- a/doc/resolv_wrapper.1 +++ b/doc/resolv_wrapper.1 @@ -28,13 +28,13 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -resolv_wrapper \- A wrapper for the dns resolving with our own resolv\&.conf\&. +resolv_wrapper \- A wrapper for dns name resolving or dns faking\&. .SH "SYNOPSIS" .sp LD_PRELOAD=libresolv_wrapper\&.so RESOLV_WRAPPER_CONF="/path/to/resolv\&.conf" \fB\&./myapplication\fR .SH "DESCRIPTION" .sp -resolv_wrapper makes it possible on most UNIX platforms to contact your own DNS implmentation in your test environment\&. It requires socket_wrapper to be able to contact it\&. +resolv_wrapper makes it possible on most UNIX platforms to contact your own DNS implmentation 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\&. .sp .RS 4 .ie n \{\ @@ -46,6 +46,17 @@ resolv_wrapper makes it possible on most UNIX platforms to contact your own DNS .\} Redirects name queries to the nameservers specified in your resolv\&.conf .RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Can fake DNS queries using a simple formatted DNS hosts file\&. +.RE .SH "ENVIRONMENT VARIABLES" .PP \fBRESOLV_WRAPPER_CONF\fR @@ -56,6 +67,36 @@ This is used to specify the resolv\&.conf to use\&. The format of the resolv\&.c directive is supported\&. .RE .PP +\fBRESOLV_WRAPPER_HOSTS\fR +.RS 4 +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: +.sp +.if n \{\ +.RS 4 +.\} +.nf +TYPE RECORD_NAME RECORD_VALUE +.fi +.if n \{\ +.RE +.\} +.RE +.sp +For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +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 +.fi +.if n \{\ +.RE +.\} +.PP \fBRESOLV_WRAPPER_DEBUGLEVEL\fR .RS 4 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\&. diff --git a/doc/resolv_wrapper.1.txt b/doc/resolv_wrapper.1.txt index c04c7c8..a9e4ec5 100644 --- a/doc/resolv_wrapper.1.txt +++ b/doc/resolv_wrapper.1.txt @@ -4,7 +4,7 @@ resolv_wrapper(1) NAME ---- -resolv_wrapper - A wrapper for the dns resolving with our own resolv.conf. +resolv_wrapper - A wrapper for dns name resolving or dns faking. SYNOPSIS -------- @@ -17,8 +17,11 @@ DESCRIPTION resolv_wrapper makes it possible on most UNIX platforms to contact your own DNS implmentation 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 --------------------- @@ -29,6 +32,21 @@ 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. +*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 + *RESOLV_WRAPPER_DEBUGLEVEL*:: If you need to see what is going on in resolv_wrapper itself or try to find a @@ -40,15 +58,6 @@ debug symbols. - 2 = DEBUG - 3 = TRACE -*RESOLV_WRAPPER_HOSTS*:: - -This environment variable is used for DNS faking. It must point to a -hosts-like text file that specifies fake records for custom queries. The -format of the file is: -TYPE RECORD_NAME RECORD_VALUE -For example: -A www.cwrap.org 127.0.0.10 - EXAMPLE ------- -- 2.34.1