Files
coredns/plugin/grpc_server
ump45nose df0e9ba5ac plugin/grpc_server: both limits accept zero, not only positive integers (#8660)
The syntax block said POSITIVE_INTEGER for both options, but plugin/grpc_server/setup.go:51 and :67 reject only val < 0 with the message "must be a non-negative integer", plugin/grpc_server/setup_test.go:53-67 feeds "max_streams 0" and "max_connections 0" with shouldErr false, and README.md:22-23 itself says "Set to 0 for unbounded" for both.

Signed-off-by: yuwk <1729065730@qq.com>
2026-10-20 17:17:49 -07:00
..
2025-12-17 19:08:59 -08:00

grpc_server

Name

grpc_server - configures DNS-over-gRPC server options.

Description

The grpc_server plugin allows you to configure parameters for the DNS-over-gRPC server to fine-tune the security posture and performance of the server.

This plugin can only be used once per gRPC listener block.

Syntax

grpc_server {
    max_streams NON_NEGATIVE_INTEGER
    max_connections NON_NEGATIVE_INTEGER
}
  • max_streams limits the number of concurrent gRPC streams per connection. This helps prevent unbounded streams on a single connection, exhausting server resources. The default value is 256 if not specified. Set to 0 for unbounded.
  • max_connections limits the number of concurrent TCP connections to the gRPC server. The default value is 200 if not specified. Set to 0 for unbounded.

Examples

Set custom limits for maximum streams and connections:

grpc://.:8053 {
    tls cert.pem key.pem
    grpc_server {
        max_streams 50
        max_connections 100
    }
    whoami
}

Set values to 0 for unbounded, matching CoreDNS behaviour before v1.14.0:

grpc://.:8053 {
    tls cert.pem key.pem
    grpc_server {
        max_streams 0
        max_connections 0
    }
    whoami
}