/*
PowerDNS Versatile Database Driven Nameserver
- Copyright (C) 2005 PowerDNS.COM BV
+ Copyright (C) 2005 - 2006 PowerDNS.COM BV
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
memcpy(&d_header, packet, sizeof(dnsheader));
+ if(d_header.opcode)
+ throw MOADNSException("Can't parse non-query packet with opcode="+ lexical_cast<string>(d_header.opcode));
+
d_header.qdcount=ntohs(d_header.qdcount);
d_header.ancount=ntohs(d_header.ancount);
d_header.nscount=ntohs(d_header.nscount);
Before proceeding, it is advised to check the release notes for your PDNS version, as specified in the name of the distribution
file.
</para>
- <sect2 id="changelog-recursor-3-1-2"><title>Recursor version 3.1.2 (unreleased)</title>
+ <sect2 id="changelog-recursor-3-1-2"><title>Recursor version 3.1.2</title>
+ <para>
+ Released Monday 26th of June 2006.
+ </para>
<para>
Compared to 3.1.1, this release consists almost exclusively of bug-fixes and speedups. A quick update is recommended, as some of the bugs
impact operators of authoritative zones on the internet. This version has been tested by some of the largest internet providers on the planet,
</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>logging-facility</term>
+ <listitem>
+ <para>
+ If set to a digit, logging is performed under this LOCAL facility. See <xref linkend="syslog"/>. Available from 3.1.3 and onwards. Do not pass names like 'local0'!
+ </para>
+ </listitem>
+ </varlistentry>
+
+
<varlistentry>
<term>max-cache-entries</term>
<listitem>
dc->setSocket(tconn.fd);
dc->d_tcp=true;
dc->setRemote(&tconn.remote);
-
if(dc->d_mdp.d_header.qr) {
delete dc;
L<<Logger::Error<<"Ignoring answer on server socket!"<<endl;
int serviceMain(int argc, char*argv[])
{
L.setName("pdns_recursor");
- L.setLoglevel((Logger::Urgency)(4));
+
+ L.setLoglevel((Logger::Urgency)(6)); // info and up
+
+ if(!::arg()["logging-facility"].empty()) {
+ boost::optional<int> val=logFacilityToLOG(::arg().asNum("logging-facility") );
+ if(val)
+ theL().setFacility(*val);
+ else
+ L<<Logger::Error<<"Unknown logging facility "<<::arg().asNum("logging-facility") <<endl;
+ }
L<<Logger::Warning<<"PowerDNS recursor "<<VERSION<<" (C) 2001-2006 PowerDNS.COM BV ("<<__DATE__", "__TIME__;
#ifdef __GNUC__
::arg().setSwitch( "logfile", "Filename of the log file" )= "recursor.log";
#else
::arg().set("quiet","Suppress logging of questions and answers")="";
+ ::arg().set("logging-facility","Facility to log messages as. 0 corresponds to local0")="";
#endif
::arg().set("config-dir","Location of configuration directory (recursor.conf)")=SYSCONFDIR;
::arg().set("socket-dir","Where the controlsocket will live")=LOCALSTATEDIR;
::arg().setCmd("help","Provide a helpful message");
::arg().setCmd("config","Output blank configuration");
- L.toConsole(Logger::Warning);
+ L.toConsole(Logger::Info);
::arg().laxParse(argc,argv); // do a lax parse
string configname=::arg()["config-dir"]+"/recursor.conf";