RFC 7766 [1] actually requires TCP support:
> Section 6.1.3.2 of [RFC1123] is updated: All general-purpose DNS implementations MUST support both UDP and TCP transport.
For stub resolvers like the ones provided by glibc and musl:
> Stub resolver implementations (e.g., an operating system's DNS resolution library) MUST support TCP since to do otherwise would limit the interoperability between their own clients and upstream servers.
[1]: https://datatracker.ietf.org/doc/html/rfc7766#section-5