Remi Gacogne [Fri, 10 Mar 2017 08:44:00 +0000 (09:44 +0100)]
auth: Hash the entire query in the packet cache, split caches
* The packet cache now behaves a lot like the ones in dnsdist and
the recursor, hashing the entire query (except the query id)
to prevent matching queries with, for example, different EDNS version.
* Since the packet and query caches have now much less in common, split
them into two different classes since it doesn't make sense to share
the same storage and maximum number of entries and doing so clarifies
the code a lot. This should also reduce contention.
* Add a new `max-packet-cache-entries` setting to control the number of
entries in the packet cache.
* Add a new metric, `query-cache-size`, the number of entries
in the query cache since `packetcache-size` is only about the packet
cache.
Note that contrary to the recursor one's, the new packet cache doesn't
skip the content of an EDNS Client Subnet option if present, in case it's
used by a backend to produce the response. We could easily change that, or
even make it configurable if we care.
Robin Geuze [Mon, 6 Mar 2017 14:59:39 +0000 (15:59 +0100)]
Fix comments from rgacogne
Use nullptr instead of NULL
Statically initialize policy to nullptr in Pool object
Actually set the global state for the pools after setting a new
server selection policy on a pool.
bert hubert [Fri, 3 Mar 2017 15:15:11 +0000 (16:15 +0100)]
Merge pull request #5094 from ahupowerdns/rfc2308
make our zone parser adhere to RFC2308 wrt implicit TTLs and add test. Adds note to release notes, plus some documentation to nobackend regression tests.
Remi Gacogne [Wed, 22 Feb 2017 16:42:02 +0000 (17:42 +0100)]
rec: Don't parse the QName in the packet cache if we already have it
When `gettag()` or protobuf are enabled, we have already parsed the
qname, qtype and qclass so pass them to the Packet Cache instead of
parsing them again.
Don't parse them several times if we have more than one match from
the cache either.
Remi Gacogne [Tue, 21 Feb 2017 15:14:09 +0000 (16:14 +0100)]
rec: Speed up the packet cache
* Don't parse the response's qname for every call to
`getResponsePacket()`, this leads to a ~15% speed up on pure retrieval
* Only hash once, keep the hash result around, leading to a ~40%
speed up on insertion
shantikulkarni [Thu, 2 Mar 2017 03:16:09 +0000 (21:16 -0600)]
SOA object is required for all reverse zones
As of 4.0.3, an reverse lookups in LDAP strict mode will not work without there being an object with an SOA entry for the reverse lookup zone. This requirement is a change from 3.3.3. (Issue #5086)
Remi Gacogne [Thu, 9 Feb 2017 14:01:41 +0000 (15:01 +0100)]
rec: Add `use-incoming-edns-subnet` to process and pass along ECS
If set, the recusor will process and pass along a received EDNS
Client Subnet to authoritative servers.
The ECS information will only be sent for netmasks and domains listed
in `edns-subnet-whitelist`, and will be truncated if the received scope
exceeds `ecs-ipv4-bits` for IPv4 or `ecs-ipv6-bits` for IPv6.
An incoming ECS source prefix-length of 0 can also be used to
request that no ECS value be sent to the authoritative servers,
in accordance with RFC7871.
Remi Gacogne [Thu, 9 Feb 2017 13:50:11 +0000 (14:50 +0100)]
Correctly parse ECS with a source prefix-length value of 0
It means there is no address there, but the family and source
prefix-length values are still relevant. rfc7871 explicitly says
that the family SHOULD be set to the transport over which the query
is sent if source prefix-length is 0.
It also states that a source prefix-length means the client is
asking that no ECS value be sent.
Remi Gacogne [Mon, 20 Feb 2017 14:45:22 +0000 (15:45 +0100)]
Rec: Store the RPZ policies in an unordered_map instead of a map
This speeds up the loading of huge zones a bit (~20%) while also nicely
improving the lookup speed.
Also adds a `zoneSizeHint` parameter to `rpzFile()` and `rpzMaster()` to be
able to reserve space before loading the zone, to prevent reallocation
and rehashing when possible.
Peter Thomassen [Mon, 20 Feb 2017 10:26:05 +0000 (11:26 +0100)]
docs: improve documentation of MySQL foreign keys
So far, the docs mentioned the foreign key for the records table only.
However, if foreign keys are used, they also make sense for the
domainmetadata, cryptokeys, and comments tables.
Corresponding SQL is already in an .sql file in the repository. This
commit replaces the incomplete information with these statements.