How do I configure linux in general to allow dns over tcp?
We discovered today that several different linux servers we use are not able to resolve DNS names with many ip addresses in the response. These response packets would be over 512 bytes, so the server sends back a UDP packet with the truncated bit set. The various processes on the server (in this case, Java, and the nslookup command) simply stop resolving the name at this point. They don't follow up by making the same request over TCP, is I hear they should.
This part is specific to alpinelinux: On alpine linux, I can enable dns lookups over TCP by installing the bind-utils package. that makes other programs on the system start properly handling truncated responses by switching to TCP. I don't know what that particular package is doing to configure this, and I so i'm left with this quesiton:
Bonus question, can this be enabled for just java without changing anything else?
We are seeing this on more than just alpine, though we stumbled upon a package that has this effect on alpine.