Commit graph

11589 commits

Author SHA1 Message Date
Michal Nowak
43552a0ab6 Limit X-Bloat header size to 100KB
Otherwise curl 8.13 rejects the line with:

    I:Check HTTP/1.1 keep-alive with truncated stream (21)
    curl: option --header: error encountered when reading a file
    curl: try 'curl --help' or 'curl --manual' for more information

Also, see https://github.com/curl/curl/pull/16572.

(cherry picked from commit bcb931f4a8)
2025-03-25 15:53:29 +00:00
Mark Andrews
f095d22adf DNS_KEYTYPE_NOKEY is only applicable to KEY
(cherry picked from commit 53c6721abc)
2025-03-25 00:04:36 -07:00
Evan Hunt
07b599748f Tidy up keyvalue.h definitions
Use enums for DNS_KEYFLAG_, DNS_KEYTYPE_, DNS_KEYOWNER_, DNS_KEYALG_,
and DNS_KEYPROTO_ values.

Remove values that are never used.

Eliminate the obsolete DNS_KEYFLAG_SIGNATORYMASK. Instead, add three
more RESERVED bits for the key flag values that it covered but which
were never used.

(cherry picked from commit fee1ba40df)
2025-03-25 00:04:31 -07:00
Aram Sargsyan
517386866d Test -T cookiealwaysvalid
Add a check in the "cookie" system test to make sure that the new
'-T cookiealwaysvalid' option works.

(cherry picked from commit 4e75a20b6a)
2025-03-17 12:01:55 +00:00
Aram Sargsyan
ac15d3dede Implement -T cookiealwaysvalid
When -T cookiealwaysvalid is passed to named, DNS cookie checks for
the incoming queries always pass, given they are structurally correct.

(cherry picked from commit 807ef8545d)
2025-03-17 12:01:42 +00:00
Mark Andrews
89e76eec70 Add missing locks when returning addresses
Add missing locks in dns_zone_getxfrsource4 et al. Addresses CID
468706, 468708, 468741, 468742, 468785 and 468778.

Cleanup dns_zone_setxfrsource4 et al to now return void.

Remove double copies with dns_zone_getprimaryaddr and dns_zone_getsourceaddr.

(cherry picked from commit d0a59277fb)
2025-03-16 15:26:12 +11:00
Mark Andrews
dcd816fbfb Tune many types tests in reclimit test
The 'I:checking that lifting the limit will allow everything to get
cached (20)' test was failing due to the TTL of the records being
too short for the elapsed time of the test.  Raise the TTL to fix
this and adjust other tests as needed.

(cherry picked from commit 1a58bd2113)
2025-03-14 05:29:35 +00:00
Evan Hunt
76b6b3ffbf when recording an rr trace, use libtool
when running a system test with the USE_RR environment
variable set to 1, an rr trace is generated for named.
because rr wasn't run using libtool --mode=execute, the
trace would actually be generated for the wrapper script
generated by libtool, not for the actual named binary.

(cherry picked from commit 00d7c7c346)
2025-03-05 08:34:25 +00:00
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