It’s not entirely clear to me what your setup is, but resolving using service name should work fine. See this sample (with this possible caveat).
Also see this: Windows contianer : how to talk to other box in the same network with computer name
I’m interested in the slowness you’re seeing, please provide more details.