DnsServer
DnsServer copied to clipboard
ip_local_port_range: prefer different parity for start/end values.
Current suggested docker compose file in repo sets:
sysctls:
- net.ipv4.ip_local_port_range=1024 65000
However on Ubuntu 24.04 server this causes error: ip_local_port_range: prefer different parity for start/end values.
The fix is to to use an odd number for the end port:
sysctls:
- net.ipv4.ip_local_port_range=1024 65535
Thanks for the post. I am not really docker expert but, the option works inside the container which is debian, so I am not sure how it is going to affect the host OS running Ubuntu. Please provide more context on the issue that you are seeing.
For what its worth, this the kernel documentation suggests 32768-60999 as the default values. Strictly, this requirement is supposed to be preferential not required, but this may vary. I can't remember the specifics off the top of my head, but its something along the lines of even ports are used for "connect" and odd are used for "bind". Maybe it was the other way around, but in any case, it is proper to use a different parity here.
@p4plus2 That config was done to override the defaults. For DNS server, its important to have large range of ports available for port randomization to have good entropy.
I can't remember the specifics off the top of my head, but its something along the lines of even ports are used for "connect" and odd are used for "bind".
I am not really aware about this. Do you have any link which explains it?
I should have been more clear, I mentioned the defaults to illustrate the parity not the specific values. The wide range makes sense in this case (and in many other server applications).
I don't remember where I initially read this, but I was able to track down a source: https://patchwork.ozlabs.org/project/netdev/patch/[email protected]/
To me, it seems like it shouldn't really cause an issue and enforcing parity seems pedantic. But it's probably easier to comply rather than risk the off chance some systems enforce the parity.
@p4plus2 thanks for the link. Will get the docker compose file updated.
Technitium DNS Server v14.0.1 is now available which resolves this issue. Do upgrade and let me know your feedback.