summaryrefslogtreecommitdiff
blob: 107097159c83f813a7be3c524f5aa0486221d557 (plain)
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
Author: Nicholas Bamber <nicholas@periapt.co.uk>
Subject: askmara-tcp lazily copies askmara usage and man page
Last-Updated: 2011-09-21
Forwarded: no
--- a/tools/askmara_labels_en.h
+++ b/tools/askmara_labels_en.h
@@ -1,11 +1,12 @@
 /* Placed in the public domain 2001 by Sam Trenholme */
 
-/* All of the labels for replies used in askmara */
+/* All of the labels for replies used in askmara(-tcp) */
 
 #define L_NEWLINE "\n"
 #define L_HARD_ERROR "Hard Error: "
 #define L_QUERYING "Querying the server with the IP "
 #define L_USAGE "Usage: askmara [-n] [-v | -t timeout] Query [server]\n#Example: askmara Ayahoo.com."
+#define L_USAGE_TCP "Usage: askmara-tcp [-n] [-v | -t timeout] Query [server]\n#Example: askmara-tcp Ayahoo.com."
 #define L_JS_CREATE_INDATA "js_create with indata"
 #define L_JS_CREATE_UINDATA "js_create with uindata"
 #define L_JS_CREATE_OUTDATA "js_create with outdata"
--- a/tools/askmara-tcp.c
+++ b/tools/askmara-tcp.c
@@ -190,7 +190,7 @@
             nrd = 1;
         else if(argv[0][0] == '-' && argv[0][1] == 'p') {
             if(argc < 2) {
-                harderror(L_USAGE);
+                harderror(L_USAGE_TCP);
                 }
             argc--;
             argv++;
@@ -201,7 +201,7 @@
             }
         else if(argv[0][0] == '-' && argv[0][1] == 't') {
             if(argc < 2) {
-                harderror(L_USAGE);
+                harderror(L_USAGE_TCP);
                 }
             argc--;
             argv++;
@@ -213,14 +213,14 @@
         else if (argv[0][0] != '-')
             break;
         else
-            harderror(L_USAGE);
+            harderror(L_USAGE_TCP);
         argc--;
         argv++;
         }
 
     /* we expect now the query string and possibly the server */
     if(argc<1)
-        harderror(L_USAGE);
+        harderror(L_USAGE_TCP);
 
     /* Determine what IP address to connect to */
     if(argc>1)
--- /dev/null
+++ b/doc/en/man/askmara-tcp.1
@@ -0,0 +1,191 @@
+.\" Do *not* edit this file; it was automatically generated by ej2man
+.\" Look for a name.ej file with the same name as this filename
+.\"
+.\" Process this file with the following
+.\" nroff -man -Tutf8 maradns.8 | tr '\020' ' '
+.\"
+.\" Last updated Mon Sep 27 15:36:06 2010
+.\"
+.TH ASKMARA-TCP 1 "askmara-tcp" "January 2002" "askmara-tcp"
+.\" We don't want hyphenation (it's too ugly)
+.\" We also disable justification when using nroff
+.\" Due to the way the -mandoc macro works, this needs to be placed
+.\" after the .TH heading
+.hy 0
+.if n .na
+.\"
+.\" We need the following stuff so that we can have single quotes
+.\" In both groff and other UNIX *roff processors
+.if \n(.g .mso www.tmac
+.ds aq \(aq
+.if !\n(.g .if '\(aq'' .ds aq \'
+
+.SH "NAME"
+.PP
+askmara-tcp \- do simple dns queries over TCP
+.SH "DESCRIPTION"
+.PP
+.B "askmara-tcp"
+queries the user-specified dns server for records, and
+outputs the reply in a csv2-compatible format (csv2 is the format of
+zone
+files that
+.B "maradns"
+uses). However unlike
+.B "askmara"
+it uses TCP rather than UDP.
+.SH "USAGE"
+.PP
+.B "askmara-tcp"
+.RB [ -n ]
+.RB [ -v | -t
+.IR timeout ]
+.I query
+.RI [ server ]
+.SH "OPTIONS"
+.PP
+.TP 4
+.BI -t
+If this is present, the following argument is the askmara-tcp
+.IR timeout ,
+in seconds. Note that
+.B "askmara-tcp"
+can not both have a user-defined
+timeout and verbose output.
+.TP 4
+.BI -v
+If this is set,
+.B "askmara-tcp"
+will verbosely output the complete reply that the server sent. Note
+that this verbose output is not csv2-compatible.
+.TP 4
+.BI -n
+If this is set,
+.BR "askmara-tcp" ","
+when sending out a query, will not
+request DNS recursion; in other words, askmara-tcp will request that the
+remote DNS server not contact other DNS servers to answer the query in
+question.
+.TP 4
+.I query
+dns record to be queried. The query has two sections:
+The type of record we desire, and the hostname we want this record for.
+.PP
+The type of query can have two forms: A one-letter mnemonic, or a
+numeric rtype followed by a colon. This is immediately concatenated by
+the full name of the host name we wish to look up.
+.PP
+For example, to ask for the IP of \(aqexample.com.\(aq, we can use the
+one-letter
+mnemonic, in the form \(aqAexample.com.\(aq, or we can use the numeric
+RR followed
+by a colon, giving the query \(aq1:example.com.\(aq (since A has the
+record type
+of one). Note that the query name needs the trailing dot at the end.
+.PP
+Askmara supports a handful one-letter mnemonics, as follows:
+.PP
+.B "A"
+signifies a request for an A (ipv4 address) RR
+.PP
+.B "N"
+signifies a NS RR
+.PP
+.B "C"
+signifies that we are asking for a CNAME RR
+.PP
+.B "S"
+signifies that we want a SOA RR
+.PP
+.B "P"
+signifies that we want a PTR RR
+.PP
+.B "@"
+signifies that we mant a MX RR
+.PP
+.B "T"
+signifies that we want a TXT RR
+.PP
+.B "Z"
+signifies that we want to ask for all RRs.
+.TP 4
+.I server
+IP address of the dns server to be queried. If no server is given,
+askmara-tcp will query 127.0.0.1.
+.PP
+.SH "EXAMPLES"
+.PP
+Asking the server with the ip 127.0.0.1 for the IP address of
+example.com:
+
+.nf
+askmara-tcp Aexample.com.
+.fi
+
+Asking the server with the ip 198.41.0.4 for the IP address of
+example.com:
+
+.nf
+askmara-tcp Aexample.com. 198.41.0.4
+.fi
+
+Asking the server with the ip address 127.0.0.1 for the IP address of
+example.com, using the rr_number:query format:
+
+.nf
+askmara-tcp 1:example.com.
+.fi
+
+Asking the server with the ip address 127.0.0.1 for a SRV record. In
+particular, we ask for the "http over tcp" service for example.net.
+Since askmara-tcp doesn\(aqt have a mnemonic for SRV record types, we
+use the numeric code (33 for SRV):
+
+.nf
+askmara-tcp 33:_http._tcp.example.net.
+.fi
+
+Asking the server with the ip address 127.0.0.1 for the AAAA (ipv6 ip)
+record for example.net:
+
+.nf
+askmara-tcp 28:example.net.
+.fi
+
+Note that the output will be a raw DNS packet in both the SRV
+and AAAA examples.
+.SH "BUGS"
+.PP
+When askmara-tcp is asked for an SOA record, the output of
+.B "askmara-tcp"
+closely resembles the format of a csv2 file, but can not be parsed as a
+csv2 file without modification.
+.PP
+askmara-tcp outputs multi-chunk ("character-string") TXT
+records incorrectly (it only outputs the first chunk).
+.SH "SEE ALSO"
+.PP
+.B maradns(8),
+.B askmara(1)
+
+.br
+http://www.maradns.org
+.SH "LEGAL DISCLAIMER"
+.PP
+THIS SOFTWARE IS PROVIDED BY THE AUTHORS \(aq\(aqAS IS\(aq\(aq AND ANY
+EXPRESS
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.SH "AUTHOR"
+.PP
+MaraDNS is written by Sam Trenholme. Jaakko Niemi used 5 minutes
+to roll this manpage together, which Sam has subsequently revised.
+