Commit Diff
Diff:
d45a63b035059e5b3c405f620782c55d83caaf5e
87f793be227972dbf7769fa1fcadbb84dbc510f9
Commit:
87f793be227972dbf7769fa1fcadbb84dbc510f9
Tree:
49a9918c69eb1b8158bf3d72f5a3f516f1968e88
Author:
pbug <pbug@delphinusdns.org>
Committer:
pbug <pbug@delphinusdns.org>
Date:
Mon Feb 16 18:23:19 2009 UTC
Message:
* add -l flag which logs queries to the daemon to syslog previously this was default and may have been costly on cpu and disk
blob - de44f842a5d3da57dc27c86755cf18dd423b0941
blob + a791a66e715039d479cc1b5042c51f04890fcffd
--- main.c
+++ main.c
@@ -63,8 +63,9 @@ int memcasecmp(char *, char *, int);
extern char *__progname;
static int Wflag = 0;
+static int lflag = 0;
-static char rcsid[] = "$Id: main.c,v 1.10 2009/02/16 13:44:40 pbug Exp $";
+static char rcsid[] = "$Id: main.c,v 1.11 2009/02/16 18:23:19 pbug Exp $";
/*
* MAIN - set up arguments, set up database, set up sockets, call mainloop
@@ -104,7 +105,7 @@ main(int argc, char *argv[])
exit(1);
}
- while ((ch = getopt(argc, argv, "b:i:f:p:W")) != -1) {
+ while ((ch = getopt(argc, argv, "b:f:i:lp:W")) != -1) {
switch (ch) {
case 'b':
bflag = 1;
@@ -114,6 +115,9 @@ main(int argc, char *argv[])
}
bind_list[bcount++] = optarg;
break;
+ case 'f':
+ conffile = optarg;
+ break;
case 'i':
iflag = 1;
if (icount > 254) {
@@ -122,8 +126,8 @@ main(int argc, char *argv[])
}
interface_list[icount++] = optarg;
break;
- case 'f':
- conffile = optarg;
+ case 'l':
+ lflag = 1;
break;
case 'p':
port = atoi(optarg) & 0xffff;
@@ -632,7 +636,8 @@ nxdomain:
}
out:
- syslog(LOG_INFO, "request on descriptor %u interface \"%s\" from %s for \"%s\" type=%u class=%u, answering \"%s\"", so, ident[i], address, question->converted_name, ntohs(question->hdr->qtype), ntohs(question->hdr->qclass), replystring);
+ if (lflag)
+ syslog(LOG_INFO, "request on descriptor %u interface \"%s\" from %s for \"%s\" type=%u class=%u, answering \"%s\"", so, ident[i], address, question->converted_name, ntohs(question->hdr->qtype), ntohs(question->hdr->qclass), replystring);
if (fakequestion != NULL) {
blob - 6719b59c24d0d02c12e8d1edfc222231420369aa
blob + 90ad39be9865f93cd35de85ed8387b240f2b8c69
--- wildcarddnsd.8
+++ wildcarddnsd.8
@@ -40,6 +40,7 @@
.Op Fl i Ar interface
.Op ...
.Oc
+.Op Fl l
.Op Fl p Ar port
.Op Fl W
.Sh DESCRIPTION
@@ -79,6 +80,8 @@ that
should listen on. This option can be specified multiple times. May not be
used in conjunction with
.Fl b .
+.It Fl l
+Turn syslog logging of queries on.
.It Xo
.Fl p
.Ar port
blob - 8a4f6e916ec7d28ac60a103be67ad1cbe76c33c5
blob + dcbdb0a79c1463c2faaf652cacc1124581c99007
--- wildcarddnsd.cat8
+++ wildcarddnsd.cat8
@@ -4,8 +4,8 @@ NNAAMMEE
wwiillddccaarrddddnnssdd - the Wildcard DNS daemon
SSYYNNOOPPSSIISS
- wwiillddccaarrddddnnssdd [[--bb _a_d_d_r_e_s_s] [...]] [--ff _f_i_l_e] [[--ii _i_n_t_e_r_f_a_c_e] [...]] [--pp
- _p_o_r_t] [--WW]
+ wwiillddccaarrddddnnssdd [[--bb _a_d_d_r_e_s_s] [...]] [--ff _f_i_l_e] [[--ii _i_n_t_e_r_f_a_c_e] [...]] [--ll]
+ [--pp _p_o_r_t] [--WW]
DDEESSCCRRIIPPTTIIOONN
wwiillddccaarrddddnnssdd is the daemon that runs Wildcard DNS.
@@ -25,6 +25,8 @@ DDEESSCCRRIIPPTTIIOONN
This option can be specified multiple times. May not be used in
conjunction with --bb.
+ --ll Turn syslog logging of queries on.
+
--pp _p_o_r_t
Specifies the _p_o_r_t that wwiillddccaarrddddnnssdd should listen on. This can
be useful when using wwiillddccaarrddddnnssdd with pf(4).
@@ -41,4 +43,4 @@ AAUUTTHHOORRSS
This software was written by Peter J. Philipp <pjp@solarscale.de>
-OpenBSD 4.3 November 27, 2005 1
+OpenBSD 4.4 November 27, 2005 1
repomaster@centroid.eu