I'm learning about Instant Messaging system and read about XMPP(RFC6120,6121,6122). These documents refer to client-to-server and server-to-server communication(using domain name), but they don't say about server-to-server routing in a domain. Can you show me some solutions or documents refer to this problem?
ex: user A want to send messages to user B, user A connect to server1, user B connect to another server in the same domain with server1(ex:example.com), so how server1 know which server(IP address) has connection with user B to forward messages?