2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 05:28:00 +00:00

2460 Commits

Author SHA1 Message Date
Matthijs Mekking
d8cf7aedfa Add DNSSEC sign operations statistics channel
Add a new statistics structure to record how many sign operations
a key has made within a zone.
2019-06-25 11:40:01 +02:00
Brian Conry
39344dfb3e Bump DNS_CLIENTINFOMETHODS_VERSION/_AGE to 2/1 in clientinfo.h
BIND 9.11.0 has bumped DNS_CLIENTINFOMETHODS_VERSION and _AGE to
version 2 and 1 in the dlz_minimal.h because a member was addet to the
dnsclientinfo struct.  It was found out that the new member is not
used anywhere and there are no accessor functions therefore the change
was reverted.

Later on, it was found out that the revert caused some problems to the
users of BIND 9, and thus this changes takes a different approach by
syncing the values other way around.
2019-06-20 12:46:21 +02:00
Tony Finch
a9dca5831b Remove cleaning-interval remnants.
Since 2008, the cleaning-interval timer has been documented as
"effectively obsolete" and disabled in the default configuration with
a comment saying "now meaningless".

This change deletes all the code that implements the cleaning-interval
timer, except for the config parser in whcih it is now explicitly
marked as obsolete.

I have verified (using the deletelru and deletettl cache stats) that
named still cleans the cache after this change.
2019-06-05 13:08:12 +10:00
Witold Kręcicki
ae52c2117e Use experimental "_ A" minimization in relaxed mode.
qname minimization, even in relaxed mode, can fail on
some very broken domains. In relaxed mode, instead of
asking for "foo.bar NS" ask for "_.foo.bar A" to either
get a delegation or NXDOMAIN. It will require more queries
than regular mode for proper NXDOMAINs.
2019-05-30 14:06:55 -07:00
Ondřej Surý
4d2d3b49ce Cleanup the way we detect json-c library to use only pkg-config 2019-05-29 15:08:52 +02:00
Michał Kępień
5e80488270 Make NTAs work with validating forwarders
If named is configured to perform DNSSEC validation and also forwards
all queries ("forward only;") to validating resolvers, negative trust
anchors do not work properly because the CD bit is not set in queries
sent to the forwarders.  As a result, instead of retrieving bogus DNSSEC
material and making validation decisions based on its configuration,
named is only receiving SERVFAIL responses to queries for bogus data.
Fix by ensuring the CD bit is always set in queries sent to forwarders
if the query name is covered by an NTA.
2019-05-09 19:55:35 -07:00
Mark Andrews
ee7cf180b3 Recognise EDNS Client Tag and EDNS Server Tag 2019-05-09 17:29:23 +10:00
Mark Andrews
d8798098e8 support printing AAAA in expanded form 2019-05-06 21:50:38 -07:00
Mark Andrews
698a6f955e <dns/ecs.h> was missing ISC_LANG_ENDDECLS. 2019-04-09 11:47:26 +10:00
Ondřej Surý
8ccce7e24b Make lib/dns/dnstap.pb-c.h private header
This changes dns_dtdata struct to not expose data types from dnstap.pb-c.h to
prevent the need for including this header where not really needed.
2019-03-22 11:38:45 +01:00
Evan Hunt
b3ff3bf2e4 remove configuration, syntax checking and implementation of dnssec-enable 2019-03-14 23:29:07 -07:00
Mark Andrews
719b1d7fdc missing #include <isc/lang.h> 2019-03-15 00:24:33 +11:00
Mark Andrews
a520662ed4 allow dlz to signal that the view's transfer acl should be used 2019-03-11 14:27:13 +11:00
Tony Finch
0f219714e1 cleanup: use dns_secalg_t and dns_dsdigest_t where appropriate
Use them in structs for various rdata types where they are missing.
This doesn't change the structs since we are replacing explicit
uint8_t field types with aliases for uint8_t.

Use dns_dsdigest_t in library function arguments.

Improve dnssec-cds with these more specific types.
2019-03-08 18:37:50 +11:00
Mark Andrews
d1fa8be611 add the ability to control whether SOA records are added response-policy modified answers 2019-03-06 20:47:28 -08:00
Matthijs Mekking
6756280242 Remove rpz->db_registered
As pointed out in !813 db_registered is sort of redundant.  It is
set to `true` only in `dns_zone_rpz_enable_db()` right before the
`dns_rpz_dbupdate_callback()` callback is registered.  It is only
required in that callback and it is the only place that the callback
is registered.  Therefore there is no path that that `REQUIRE` can
fail.

The `db_registered` variable is only set to `false` in
`dns_rpz_new_zone`, so it is not like the variable is unset again
later.

The only other place where `db_registered` is checked is in
`rpz_detach()`.  If `true`, it will call
`dns_db_updatenotify_unregister()`.  However if that happens, the
`db_registered` is not set back to `false` thus this implies that
this may happen multiple times.  If called a second time, most
likely the unregister function will return `ISC_R_NOTFOUND`, but
the return value is not checked anyway.  So it can do without the
`db_registered` check.
2019-02-22 13:59:10 +01:00
Matthijs Mekking
f09352d20a Update keyfetch_done compute_tag check
If in keyfetch_done the compute_tag fails (because for example the
algorithm is not supported), don't crash, but instead ignore the
key.
2019-02-20 19:44:33 -08:00
Tony Finch
2e173bbd24 cleanup: allow building DS directly from CDNSKEY
Relax an assertion in lib/dns/ds.c so that dnssec-cds does
not have to work around it. This will also be useful for
dnssec-dsfromkey.
2019-02-05 22:57:13 -05:00
Evan Hunt
3c75d5d7c5 add more key maintenance event logging
log when a key is:
- published in the DNSKEY rrset
- activated
- deactivated
- unpublished from the DNSKEY rrset
- revoked
2019-01-31 12:18:55 -08:00
Matthijs Mekking
924ebc605d Print in dump-file stale ttl
This change makes rndc dumpdb correctly print the "; stale" line.
It also provides extra information on how long this data may still
be served to clients (in other words how long the stale RRset may
still be used).
2019-01-30 14:11:12 -08:00
Evan Hunt
13c799267b remove the 'new_tsigkey' exception, allow TSIG to be set any time
this allows 'dns_message_settsigkey()' to be run any time after
parsing without having to set a special flag in the message object.
2019-01-30 11:46:11 -08:00
Evan Hunt
33ec311332 allow TSIG key to be added to message structure after parsing
up until now, message->tsigkey could only be set during parsing
of the request, but gss-tsig allows one to be created afterward.

this commit adds a new flag to the message structure, `new_tsigkey`,
which indicates that in this case it's okay for `dns_message_settsigkey()`
to be run on a message after parsing, without hitting any assertions due
to the lack of a TSIG in the request. this allows us to keep the current
restriction in place generally, but add an exception for TKEY processing.
it's probably better to just remove the restriction entirely (see next
commit).
2019-01-30 11:46:11 -08:00
Witold Kręcicki
b49310ac06 If possible don't use forwarders when priming the resolver.
If we try to fetch a record from cache and need to look into
hints database we assume that the resolver is not primed and
start dns_resolver_prime(). Priming query is supposed to return
NSes for "." in ANSWER section and glue records for them in
ADDITIONAL section, so that we can fill that info in 'regular'
cache and not use hints db anymore.
However, if we're using a forwarder the priming query goes through
it, and if it's configured to return minimal answers we won't get
the addresses of root servers in ADDITIONAL section. Since the
only records for root servers we have are in hints database we'll
try to prime the resolver with every single query.

This patch adds a DNS_FETCHOPT_NOFORWARD flag which avoids using
forwarders if possible (that is if we have forward-first policy).
Using this flag on priming fetch fixes the problem as we get the
proper glue. With forward-only policy the problem is non-existent,
as we'll never ask for root server addresses because we'll never
have a need to query them.

Also added a test to confirm priming queries are not forwarded.
2019-01-16 17:41:13 -05:00
Ondřej Surý
e2cdf066ea Remove message catalogs 2019-01-09 23:44:26 +01:00
Matthijs Mekking
1dd11fc754 Allow unsupported alg in zone /w dnssec-signzone
dnssec-signzone should sign a zonefile that contains a DNSKEY record
with an unsupported algorithm.  Current behavior is that it will
fail, hitting a fatal error.  The fix detects unsupported algorithms
and will not try to add it to the keylist.

Also when determining the maximum iterations for NSEC3, don't take
into account DNSKEY records in the zonefile with an unsupported
algorithm.
2018-12-19 12:54:31 +01:00
Mark Andrews
f4ceb12b69 create dns_rdatatype_atcname to split records that can appear along side CNAME from DNSSEC; dns_rdatatype_iszonecutauth allowed too many types 2018-12-14 12:48:55 +11:00
Ondřej Surý
e69dc0dbc7 Remove RSAMD5 support 2018-12-11 11:32:24 +01:00
Evan Hunt
fd20f10d52 name change from "hook modules" to "plugins"
- "hook" is now used only for hook points and hook actions
- the "hook" statement in named.conf is now "plugin"
- ns_module and ns_modlist are now ns_plugin and ns_plugins
- ns_module_load is renamed ns_plugin_register
- the mandatory functions in plugin modules (hook_register,
  hook_check, hook_version, hook_destroy) have been renamed
2018-12-06 10:36:50 -08:00
Evan Hunt
b94945e606 refactor to support multiple module instances
- use a per-view module list instead of global hook_modules
- create an 'instance' pointer when registering modules, store it in
  the module structure, and use it as action_data when calling
  hook functions - this enables multiple module instances to be set
  up in parallel
- also some nomenclature changes and cleanup
2018-12-06 10:29:12 -08:00
Evan Hunt
427e9ca357 clear AD flag when altering response messages
- the AD flag was not being cleared correctly when filtering
- enabled dnssec valdiation in the filter-aaaa test to confirm this
  works correctly now
2018-12-06 10:29:11 -08:00
Evan Hunt
81f58e2ea2 enable modules to store data in qctx
- added a 'hookdata' array to qctx to store pointers to up to
  16 blobs of data which are allocated by modules as needed.
  each module is assigned an ID number as it's loaded, and this
  is the index into the hook data array. this is to be used for
  holding persistent state between calls to a hook module for a
  specific query.
- instead of using qctx->filter_aaaa, we now use qctx->hookdata.
  (this was the last piece of filter-aaaa specific code outside the
  module.)
- added hook points for qctx initialization and destruction. we get
  a filter-aaaa data pointer from the mempool when initializing and
  store it in the qctx->hookdata table; return to to the mempool
  when destroying the qctx.
- link the view to the qctx so that detaching the client doesn't cause
  hooks to fail
- added a qctx_destroy() function which must be called after qctx_init;
  this calls the QCTX_DESTROY hook and detaches the view
- general cleanup and comments
2018-12-06 10:29:11 -08:00
Evan Hunt
9911c835d3 add a parser to filter-aaaa.so and pass in the parameters
- make some cfg-parsing functions global so they can be run
  from filter-aaaa.so
- add filter-aaaa options to the hook module's parser
- mark filter-aaaa options in named.conf as obsolete, remove
  from named and checkconf, and update the filter-aaaa test not to
  use checkconf anymore
- remove filter-aaaa-related struct members from dns_view
2018-12-06 10:29:11 -08:00
Evan Hunt
d2f4644388 add hook statement to configuration parser
- allow multiple "hook" statements at global or view level
- add "optional bracketed text" type for optional parameter list
- load hook module from specified path rather than hardcoded path
- add a hooktable pointer (and a callback for freeing it) to the
  view structure
- change the hooktable functions so they no longer update ns__hook_table
  by default, and modify PROCESS_HOOK so it uses the view hooktable, if
  set, rather than ns__hook_table. (ns__hook_table is retained for
  use by unit tests.)
- update the filter-aaaa system test to load filter-aaaa.so
- add a prereq script to check for dlopen support before running
  the filter-aaaa system test

not yet done:
- configuration parameters are not being passed to the filter-aaaa
  module; the filter-aaaa ACL and filter-aaaa-on-{v4,v6} settings are
  still stored in dns_view
2018-12-06 10:29:11 -08:00
Evan Hunt
d43dcef139 refactor filter-aaaa implementation
- the goal of this change is for AAAA filtering to be fully contained
   in the query logic, and implemented at discrete points that can be
   replaced with hook callouts later on.
 - the new code may be slightly less efficient than the old filter-aaaa
   implementation, but maximum efficiency was never a priority for AAAA
   filtering anyway.
 - we now use the rdataset RENDERED attribute to indicate that an AAAA
   rdataset should not be included when rendering the message. (this
   flag was originally meant to indicate that an rdataset has already
   been rendered and should not be repeated, but it can also be used to
   prevent rendering in the first place.)
 - the DNS_MESSAGERENDER_FILTER_AAAA, NS_CLIENTATTR_FILTER_AAAA,
   and DNS_RDATASETGLUE_FILTERAAAA flags are all now unnecessary and
   have been removed.
2018-12-06 10:29:10 -08:00
Evan Hunt
70cc3f803e set up hooks.c to enable setting hook points and loading modules
- move hooks.h to public include directory
- ns_hooktable_init() initializes a hook table. if NULL is passed in, it
  initializes the global hook table
- ns_hooktable_save() saves a pointer to the current global hook table.
- ns_hooktable_reset() replaces the global hook table with different
  one
- ns_hook_add() adds hooks at specified hook points in a hook table (or
  the global hook table if the specified table is NULL)
- load and unload functions support dlopen() of hook modules (this is
  adapted from dyndb and not yet functional)
- began adding new hook points to query.c
2018-12-06 10:29:05 -08:00
Mark Andrews
a487473fc5 add missing DBC checks for catz and add isc_magic checks; add DBC checks to ht.c 2018-11-29 12:39:20 +11:00
Witold Kręcicki
559ce1e330 use REUSEPORT only for NOLISTEN dispatchers 2018-11-15 08:21:17 +00:00
Mark Andrews
50714a9b35 free tmpzonename and restart_master 2018-11-14 11:23:21 -08:00
Ondřej Surý
e9a939841d Add min-cache-ttl and min-ncache-ttl keywords
Sometimes it is useful to set a 'floor' on the TTL for records
to be cached.  Some sites like to use ridiculously low TTLs for
some reason, and that often is not compatible with slow links.

Signed-off-by: Michael Milligan <milli@acmeps.com>
Signed-off-by: LaMont Jones <lamont@debian.org>
2018-11-14 18:24:53 +01:00
Tony Finch
1b1d63acd8 Fixes for rndc nta user interface
Tell the user explicitly about their mistakes:

* Unknown options, e.g. -list instead of -dump
  or -delete instead of -remove.

* Unknown view names.

* Excess arguments.

Include the view name in `rndc nta -dump` output, for consistency with
the NTA add and remove actions.

When removing an NTA from all views, do not abort with an error if the
NTA was not found in one of the views.
2018-11-05 22:01:28 -08:00
Tony Finch
3064d3d0ef Abolish ip6.int support in dig and mdig 2018-11-05 19:07:31 -05:00
Ondřej Surý
d6c50674bb Remove last traces of DSA and NSEC3DSA algorithm, but restore the algnumber -> name mapping 2018-10-26 11:50:11 +02:00
Michał Kępień
2cb9e8a020 Replace the "mirror" zone option with "type mirror;"
Use a zone's 'type' field instead of the value of its DNS_ZONEOPT_MIRROR
option for checking whether it is a mirror zone.  This makes said zone
option and its associated helper function, dns_zone_mirror(), redundant,
so remove them.  Remove a check specific to mirror zones from
named_zone_reusable() since another check in that function ensures that
changing a zone's type prevents it from being reused during
reconfiguration.
2018-10-24 20:32:55 +02:00
Michał Kępień
e1bb8de6f0 Define a separate dns_zonetype_t for mirror zones
Rather than overloading dns_zone_slave and discerning between a slave
zone and a mirror zone using a zone option, define a separate enum
value, dns_zone_mirror, to be used exclusively by mirror zones.  Update
code handling slave zones to ensure it also handles mirror zones where
applicable.
2018-10-24 20:32:55 +02:00
Mark Andrews
23766ff690 checkpoint 2018-10-23 12:15:04 +00:00
Witold Kręcicki
f2af336dc4 Fix looping issues 2018-10-23 12:15:04 +00:00
Witold Kręcicki
70a1ba20ec QNAME miminimization should create a separate fetch context for each fetch -
this makes the cache more efficient and eliminates duplicates queries.
2018-10-23 12:15:04 +00:00
Evan Hunt
51c6f4b682 extend DNSTAP to record UPDATE requests and responses as a separate type 2018-10-03 01:03:56 -07:00
Mark Andrews
fbeefd4990 add krb5-selfsub and ms-selfsub 2018-09-10 09:32:31 +10:00
Ondřej Surý
ac21bbb13a Add C++ declarations to dns/fixedname.h
(cherry picked from commit 94a1c853668f30bda46b1cd26d8f30a913a658fe)
2018-09-06 08:11:30 +10:00