I use duckdns and the only service I'm accessing through that CNAME is ssh, which checks host keys, so it doesn't have to be a problem.
Re:Duck DNS – About
by drexlspivey on Friday October 28, 2022 @10:49AM
(#33372031)
wouldn’t that invalidate the cerificate?
A rouge DNS can reply to select queries with the IP of a middleware that can TLS proxy and/or MitM that traffic.
We built such a thing mostly for anti-censorship purposes (bypass IP blocks): https://github.com/celzero/midway#demo