In Smack API, there is a configuration class for connection, described at this page
ConnectionConfiguration
I am confused about the distinction between service n
You can host an XMPP domain over any host, provided that you set the SRV records right in the DNS or if the client specifies to which host it is supposed to connect (like email).