domain::resolv::stub::StubResolver doesn't fail over to TCP if there's no TCP entry in the ResolvConf
This might not be a bug, but it's perhaps surprising that the stub resolver doesn't fail over to TCP on truncation unless there's TCP explicitly added in the ResolvConf::servers. I would assume that adding a server with protocol UDP means you prefer to talk to that server over UDP, but failover on truncation would work. Similarly, if you add a server with protocol TCP it means you prefer to talk to server over TCP and there failover on truncation doesn't apply. I am happy to add a PR but thought I would open a ticket first to get your input on what would be the best way to solve this. I would probably make the failover to TCP on TC automatic with no changes to the API, but it would also work if you added something like Protocol::UdpOrTcp or convey this through some other way.
Hi @vavrusa! This is more than a little embarrassing, but I somehow missed your issue for, er, a long time.
I think your proposal to have a separate protocol that does first UDP and then TCP is probably the best way forward – this will still allow only using UDP or TCP by including the right set of servers.