Commit Graph

11581 Commits

Author SHA1 Message Date
Mark Andrews
fef5052067 Check insecure response with missing RRSIG in authority
This scenario should succeed but wasn't due rejection of the
message at the message parsing stage.

(cherry picked from commit 4271d93f00)
2025-02-21 14:20:56 +11:00
Evan Hunt
925d3a7bd2 add a test with an inconsistent NS RRset
add a zone with different NS RRsets in the parent and child,
and test resolver and forwarder behavior with and without +CD.

(cherry picked from commit e4652a0444)
2025-02-19 18:55:05 -08:00
Mark Andrews
86e65f317a Re-fetch pending records that failed validation
If a deferred validation on data that was originally queried with
CD=1 fails, we now repeat the query, since the zone data may have
changed in the meantime.

(cherry picked from commit 04b1484ed8)
2025-02-18 23:59:10 +00:00
Mark Andrews
39bfa739fb Add stripped DS RRSIG senario
(cherry picked from commit 66f293a952)
2025-02-18 23:59:10 +00:00
Mark Andrews
1b814f1ee9 Add stripped DNSKEY RRSIG senario
(cherry picked from commit a71b617566)
2025-02-18 23:59:10 +00:00
Michal Nowak
cab3f3bc07 Rewrite keyfromlabel system test to pytest
(cherry picked from commit 409f394d6e)
2025-02-18 10:15:49 +01:00
Michal Nowak
4688e32065 Rewrite keepalive system test to pytest
(cherry picked from commit b804a70fac)
2025-02-17 20:29:01 +01:00
Michal Nowak
8cb3eb5d9d Add Dig interface
(cherry picked from commit 7347abd01f)
2025-02-17 20:27:53 +01:00
Petr Menšík
b880947188 Finalize removal of memory debug flags size and mctx
Commit 4b3d0c6600 has removed them, but
did not remove few traces in documentation and help. Remove them from
remaining places.
2025-02-17 16:48:43 +00:00
Mark Andrews
e0bf0cad08 Move SVCB and HTTPS to be in type code order
(cherry picked from commit 559fac329a)
2025-02-14 13:44:49 +11:00
Mark Andrews
16c6858ebc Test cname-and-other-data against various types
(cherry picked from commit dfc367f52c)
2025-02-14 13:44:49 +11:00
Michal Nowak
0a3b450925 Rewrite names system test to pytest
dnspython 2.7.0 or newer is needed because of wire().

(cherry picked from commit 5250ad8720)
2025-02-13 18:29:35 +00:00
Ondřej Surý
c9288ea3d7 Print the expiration time of the stale records (not ancient)
In #1870, the expiration time of ANCIENT records were printed, but
actually the ancient records are very short lived, and the information
carries a little value.

Instead of printing the expiration of ANCIENT records, print the
expiration time of STALE records.
2025-02-04 18:07:30 +01:00
Mark Andrews
8325f4e872 Fix gratuitious DNS protocol errors in the ANS servers
The ANS servers were not to written to handle NS queries at the
QNAME resulting in gratuitious protocol errors that will break tests
when NS requests are made for the QNAME.

(cherry picked from commit 0680eb6f64)
2025-02-04 02:37:39 +00:00
Ondřej Surý
9a8483bece In cache, set rdataset TTL to 0 when the header is not active
When the header has been marked as ANCIENT, but the ttl hasn't been
reset (this happens in couple of places), the rdataset TTL would be
set to the header timestamp instead to a reasonable TTL value.

Since this header has been already expired (ANCIENT is set), set the
rdataset TTL to 0 and don't reuse this field to print the expiration
time when dumping the cache.  Instead of printing the time, we now
just print 'expired (awaiting cleanup'.

(cherry picked from commit 1bbb57f81b)
2025-02-03 15:04:36 +01:00
Evan Hunt
291d0d8d90 fix the cache findzonecut implementation
the search for the deepest known zone cut in the cache could
improperly reject a node containing stale data, even if the
NS rdataset wasn't the data that was stale.

this change also improves the efficiency of the search by
stopping it when both NS and RRSIG(NS) have been found.

(cherry picked from commit 1f095b902c)
2025-02-02 13:22:32 -08:00
Michał Kępień
64367010f2 Fix "rndc flushname" for longer name server names
dns_adb_flushname() calls dns_name_hash() to determine the ADB bucket
number to search for the given name.  Meanwhile, all other functions in
lib/dns/adb.c call dns_name_fullhash() for determining the bucket number
instead.  This discrepancy causes dns_adb_flushname() to have virtually
no chances of actually removing the given name from the ADB if the
name is longer than 16 bytes (since dns_name_hash() only hashes the
first 16 bytes of the name provided to it) - more specifically, the
probability of success for names longer than 16 bytes is inversely
proportional to the number of ADB buckets in use, i.e. 1:1021 at best.

Fix by using dns_name_fullhash() instead of dns_name_hash() in
dns_adb_flushname(), so that the logic for determining the bucket number
that a given name belongs to is consistent throughout lib/dns/adb.c.
2025-01-30 07:44:18 +01:00
Andoni Duarte Pintado
73997c8161 Merge tag 'v9.18.33' into bind-9.18 2025-01-29 17:23:11 +01:00
Michal Nowak
48a77b943a Fix broken links in documentation
Some detected links are not to be verified (127.*, dnssec-or-not.com)
and some I can't fix (flaticon, godaddy, icann), but they are not
crucial.

(cherry picked from commit 8302469507)
2025-01-24 14:38:52 +01:00
Matthijs Mekking
7545157fe8 Clarify dnssec-signzone interval option
There was confusion about whether the interval was calculated from
the validity period provided on the command line (with -s and -e),
or from the signature being replaced.

Add text to clarify that the interval is calculated from the new
validity period.

(cherry picked from commit ae42fa69fa)
2025-01-23 11:13:15 +00:00
Mark Andrews
60c441eeff Check delv +yaml negative response output
(cherry picked from commit 9c04640def)
2025-01-22 23:58:54 +00:00
Ondřej Surý
4cc1160e4d Replace linked lists with the hashtables to hold fetch contexts
When the recursive-clients value is too large, the linked lists holding
the fetch contexts can also grow large and since the algorithm to merge
outgoing queries is quadratic, named can get slow.

Replace the linked list with hashtable for faster lookups.  This also
allows us to reduce the number of tasks (buckets) in the resolver.
2025-01-22 15:06:04 +01:00
Ondřej Surý
1b9d949534 Remove --with-tuning=small/large configuration option
The last remaining tuning value was RESOLVER_NTASKS and instead of
having variable number of the tasks per-cpu and in named and in
dns_client, set the number of the resolver tasks to 523 (number taken
from dns_client unit) to accomodate most of the recursive-clients
values.
2025-01-22 14:16:40 +01:00
Ondřej Surý
fa7b7973e3 Limit the additional processing for large RDATA sets
When answering queries, don't add data to the additional section if
the answer has more than 13 names in the RDATA.  This limits the
number of lookups into the database(s) during a single client query,
reducing query processing load.

Also, don't append any additional data to type=ANY queries. The
answer to ANY is already big enough.

(cherry picked from commit a1982cf1bb)
2025-01-15 14:13:45 +01:00
Ondřej Surý
cd48dcb0f8 Isolate using the -T noaa flag only for part of the resolver test
Instead of running the whole resolver/ns4 server with -T noaa flag,
use it only for the part where it is actually needed.  The -T noaa
could interfere with other parts of the test because the answers don't
have the authoritative-answer bit set, and we could have false
positives (or false negatives) in the test because the authoritative
server doesn't follow the DNS protocol for all the tests in the resolver
system test.

(cherry picked from commit e51d4d3b88)
2025-01-15 14:13:17 +01:00
Mark Andrews
9fa4bd1c1b Fix startup notify rate test
The terminating conditions for the startup notify test would
occasionally get ~20 records or get +10 seconds of records due to
a bad terminating condition.  Additionally 20 samples lead to test
failures.  Fix the terminating condition to use the correct conditional
(-eq -> -ge) and increase the minimum number of log entries to
average over to 22.

(cherry picked from commit 46388d07a2)
2024-12-13 12:06:33 +11:00
Michal Nowak
5825e79375 Wait for "all zones loaded" after rndc reload in "database" test
After the rndc reload command finished, we might have queried the
database zone sooner than it was reloaded because rndc reloads zones
asynchronously if no specific zone was provided. We should wait for "all
zones loaded" in the ns1 log to be sure.

(cherry picked from commit 0bdd03db66)
2024-12-12 12:09:35 +00:00
Michal Nowak
ab5309164b Add rr-related common test artifacts
(cherry picked from commit c607237b77)
2024-12-10 18:51:21 +01:00
Mark Andrews
2bef516b1c Use a different burst name to identify test queries
This allows easier identification of which burst is which in
named.run.

(cherry picked from commit e02d66b279)
2024-12-10 05:56:28 +00:00
Mark Andrews
e7a16f2e6e Fix static stub subtest description
(cherry picked from commit f173a01454)
2024-12-10 03:37:26 +00:00
Matthijs Mekking
84519c106c Change default max-recursion-queries to 50
Changing the default for max-recursion-queries from 100 to 32 was too
strict in some cases, especially lookups in reverse IPv6 trees started
to fail more frequently. From issue #4921 it looks like 50 is a better
default.

Now that we have 'max-query-count' as a global limit of outgoing queries
per client request, we can increase the default for
'max-recursion-queries' again, as the number of recursive queries is
no longer bound by the multiple of 'max-recursion-queries' and
'max-query-restarts'.

(cherry picked from commit 84df920d9e)
2024-12-06 15:17:53 +00:00
Matthijs Mekking
69b2f99c00 Add a CAMP test case
This adds a new test directory specifically for CAMP attacks. This first
test in this test directory follows multiple CNAME chains, restarting
the max-recursion-queries counter, but should bail when the global
maximum quota max-query-count is reached.

(cherry picked from commit 73eafaba14)
2024-12-06 15:17:53 +00:00
Matthijs Mekking
a0ce89bc15 Implement global limit for outgoing queries
This global limit is not reset on query restarts and is a hard limit
for any client request.

Note: This commit has been significantly modified because of many
merge conflicts due to the dns_resolver_createfetch api changes.

(cherry picked from commit 16b3bd1cc7)
2024-12-06 15:17:53 +00:00
Matthijs Mekking
5a806910a8 Implement 'max-query-count'
Add another option to configure how many outgoing queries per
client request is allowed. The existing 'max-recursion-queries' is
per restart, this one is a global limit.

(cherry picked from commit bbc16cc8e6)
2024-12-06 15:17:53 +00:00
Matthijs Mekking
7068d0698f Add test case for nsupdate hangs on large update
This test case hangs, despite the update being performed on the
name server.

(cherry picked from commit 3adabb4f89)
2024-12-06 09:26:40 +00:00
Mark Andrews
59255ca3a1 Check dnssec-signzone behaviour with revoked keys
Only DNSKEY records should be signed with a revoked key.

(cherry picked from commit 30ef6dde05)
2024-12-06 12:25:54 +11:00
Mark Andrews
5de305195b Do not sign non DNSKEY RRset with revoked keys
It does not make sense to sign RRsets other than DNSKEY with revoked
keys.

(cherry picked from commit 23775c6006)
2024-12-06 01:00:13 +00:00
Michal Nowak
2f093e7c95 Add ns2/managed1.conf to mkeys extra_artifacts
The ns2/managed1.conf file is created by the setup.sh script. Then, in
the tests.sh script it is moved to ns2/managed.conf. The latter file
name is in mkeys extra_artifacts, but the former one is not. This is a
problem when pytest is started with the --setup-only option as it only
runs the setup.sh script (e.g., in the cross-version-config-tests CI
job) and thus failing the "Unexpected files found" assertion.

(cherry picked from commit e7d973bd00)
2024-12-05 11:17:55 +01:00
Aram Sargsyan
8607730d82 Fix the nslookup system test
The nslookup system test checks the count of resolved addresses in
the CNAME tests using a 'grep' match on the hostname, and ignoring
lines containing the 'canonical name' string. In order to protect
the check from intermittent failures like the 'address in use' warning
message, which then automatically resolves after a retry, edit the
'grep' matching string to also ignore the comments (as the mentioned
warning message is a comment which contains the hostname).

(cherry picked from commit 345b0f9e5c)
2024-11-27 13:35:30 +00:00
JINMEI Tatuya
318fcc4c35 update system tests to confirm new log messages
(cherry picked from commit 000720fe14)
2024-11-27 12:34:11 +11:00
Michal Nowak
4aba98b186 Rewrite emptyzones system test to pytest
(cherry picked from commit 3ace62472c)
2024-11-26 16:11:44 +00:00
Michal Nowak
2006193711 Add isctest.check.refused()
(cherry picked from commit 7bedd1c296)
2024-11-26 16:11:44 +00:00
Michal Nowak
a21c650ad0 Rewrite database system test to pytest
(cherry picked from commit 8005ad0dcd)
2024-11-26 16:10:27 +00:00
Nicki Křížek
972a6722de Add all env vars to jinja2 templates
Ensure that the jinja2 templates have all the environment variables
which are available to the tests present.

This omission during the original 9.18 backport caused an issue where
port numbers (determined by the pytest framework) wouldn't be available
in jinja2 templates.
2024-11-26 16:10:27 +00:00
Nicki Křížek
bbd398d846 Ignore test artifacts in .libs
Some tests may leave artifacts in the .libs directory. Ignore this
directory when detecting expected artifacts.

(cherry picked from commit cf606a9ead)
2024-11-26 10:10:44 +01:00
Nicki Křížek
2f54aa22c7 Allow re-run of mkeys system test
On some slow systems, the test might intermittently fail due to inherent
timing issues. In our CI, this most often happens in the
system:gcc:8fips:amd64 jobs.

(cherry picked from commit a299650a6f)
2024-11-25 15:39:11 +01:00
Ondřej Surý
b3d8f2796a Remove redundant semicolons after the closing braces of functions
(cherry picked from commit 1a19ce39db)
2024-11-19 16:06:49 +01:00
Ondřej Surý
c5bac96fd0 Remove redundant parentheses from the return statement
(cherry picked from commit 0258850f20)
2024-11-19 16:06:16 +01:00
Matthijs Mekking
30204d0b9d Revert "Test that the correct NSEC3 closest encloser is returned"
This reverts commit 74b6aa8dd2.
2024-11-15 13:14:30 +00:00
Nicki Křížek
9f72923518 Ensure pytest runner get proper outcome from flaky reruns
When a test is re-run by the flaky plugin, the TestReport outcomes
collected in the pytest_runtest_makereport() hook should be overriden.
Each of the setup/call/teardown phases is reported again and since we
care about the overall outcome, their respective results should be
overriden so that only the outcome from the final test (re)run gets
reported.

Prior to this change, it lead to a situation where an extra_artifact
generated during the test might be ignored. This was caused because the
check was skipped, since the test was incorrectly considered as "failed"
in the case where the test would fail on the first run, but pass on a
subsequent flaky rerun.

(cherry picked from commit b66fb31dcb)
2024-11-12 10:20:34 +00:00