COREDNS-MULTISOCKET(7)
π COREDNS-MULTISOCKET π
okay so bestie, you're reading the multisocket page from the CoreDNS Plugins manual, section 7. it's giving "one port, many servers, zero gatekeeping" and honestly? iconic. here's everything, no cap π
β¨ NAME β¨
multisocket β allows to start multiple servers that will listen on one port.
π¦ DESCRIPTION π¦
With multisocket, you can define the number of servers that will listen on the same port. The SO_REUSEPORT socket option allows to open multiple listening sockets at the same address and port. In this case, kernel distributes incoming connections between sockets. slay, the kernel is doing the matchmaking for you π₯
Enabling this option allows to start multiple servers, which increases the throughput of CoreDNS in environments with a large number of CPU cores. literally main character energy for your big beefy multicore box π
π SYNTAX π
multisocket [NUM_SOCKETS]
NUM_SOCKETSβ the number of servers that will listen on one port. Default value is equal toGOMAXPROCS. Maximum value is1024. π
πΈ EXAMPLES πΈ
Start 5 TCP/UDP servers on the same port. five little besties, all vibing on one socket π«Ά
. {
multisocket 5
forward . /etc/resolv.conf
}
Do not define NUM_SOCKETS, in this case it will take a value equal to GOMAXPROCS. let the plugin pick for you, it's got you π
. {
multisocket
forward . /etc/resolv.conf
}
β RECOMMENDATIONS β
The tests of the multisocket plugin, which were conducted for NUM_SOCKETS from 1 to 10, did not reveal any side effects or performance degradation. we ran it, it ate, no crumbs left π
This means that the multisocket plugin can be used with a default value that is equal to GOMAXPROCS. easy mode, honestly.
However, to achieve the best results, it is recommended to consider the specific environment and plugins used in CoreDNS. To determine the optimal configuration, it is advisable to conduct performance tests with different NUM_SOCKETS, measuring Queries Per Second (QPS) and system load. ngl this is the "do your homework" part, but it's worth it π
If conducting such tests is difficult, follow these recommendations:
- Determine the maximum CPU consumption of CoreDNS server without
multisocketplugin. Estimate how much CPU CoreDNS actually consumes in specific environment under maximum load. π - Align
NUM_SOCKETSwith the estimated CPU usage and CPU limits or system's available resources.
Examples:
- If CoreDNS consumes 4 CPUs and 8 CPUs are available, set
NUM_SOCKETSto2. π§ - If CoreDNS consumes 8 CPUs and 64 CPUs are available, set
NUM_SOCKETSto8. π₯
π LIMITATIONS π
The multisocket value used for a given listen address is taken from the first server block that binds to that address in the Corefile. Subsequent server blocks using the same address will not change it. Different addresses may use different values. first one wins, periodt β the rest just don't get a say π
The SO_REUSEPORT socket option is not available for some operating systems. It is available since Linux Kernel 3.9 and not available for Windows at all. Windows besties... it's not happening, sorry π
Using this plugin with a system that does not supportSO_REUSEPORTwill cause anaddress already in useerror. this is the danger zone, do a vibe check on your kernel before you ship it β οΈ
okay that's the whole page, you're basically a multisocket expert now, iykyk π
β¨ this was brought to you by CoreDNS, dated March 2026, from the CoreDNS Plugins collection β go forth and multiplex, bestie, and remember: one port, many sockets, no drama ππ¦π
π¦ where this page comes from
- nixpkgs unstable: coredns 1.14.7
- opensuse-leap 16.0: coredns-extras 1.15.0-bp160.1.1 Β· Apache-2.0 AND MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms