There are a couple of "names" that come into play here. Let me elaborate a little:
First, there's the XMPP domain name. This is the name under which your XMPP domain will be known. users on your domain will get a JID that includes this name. For example, user 'john' on XMPP domain 'example.org' will have for a JID: 'email@example.com'.
Second, there's the fully qualified domain name of the server that is running Openfire. This is a more low-leven network address. Users typically need not know this address. FQDN values can be IP addresses, but you'll avoid lots of issues when you use a domain name instead (you should prefer "chatserver22.example.org" over "203.0.113.1").
To illustrate the difference, imagine a cluster of Openfire servers. Each of the servers are part of the same XMPP domain (their XMPP domain name is the same), but each will have a distinct fully qualified domain name.
There are a couple of confusing bits:
- Terminology in Openfire and Spark is not consistent. Sometimes, "server name" refers to the XMPP domain name, sometimes it refers to the fully qualified domain name of the server.
- It is perfectly valid for the XMPP domain name and the FQDN of the server to be the same.
- The implementation of various clients and libraries are gradually being improved, security-wise. This leads to situations in which a configuration worked for older versions of software won't work any longer after upgrades.
- Openfire does a poor job of determining its fully qualified domain name of the server (typically, the hostname is used instead).
When you log in with a client (such a Spark), you'll provide your username and your XMPP domain name: the two parts that make up the JID (some clients ask you for the JID instead of both a username and domain - it's basically the same thing). A password is provided too, obviously.
Based on the XMPP domain name that you provided, your client will start to determine to what host it needs to connect:
- It will attempt to do a DNS SRV lookup, which is a specialized DNS query that is used to determine what servers in a domain provide a particular service (in our case: an XMPP service).
- If no DNS SRV records are available, the client will assume that your server is reachable on a network address that is equal to your XMPP domain name.
In most clients, you can override this routine by explicitly defining a "connect host". In Spark, you do this by using the "advanced" button on the login screen. There, you'll be able to disable the automatic detection of the host, and provide one yourself instead.
(Note: the following is true for most Openfire versions up to the one that's most recent at the time of writing - openfire 4.0.3, but might change in the future): To find out what the configured XMPP domain name and fully qualified domain name of your Openfire server is, log into the admin console. After logging in, they're both presented on the first page that you see. In the box named "server properties", there's a value for "server name". That's your XMPP domain name. There's also a box named "environment", that has a value for "host name". That is what Openfire thinks is your fully qualified domain name.
To change the XMPP domain name of your Openfire server, re-run setup. You should generally not do this on a server that has already been in use: the change will affect all registered users - they'll get new JIDs, which means that they're not reachable any longer under their old JIDs.
To change the fully qualified domain name of your Openfire server, set (or change) the property "xmpp.fqdn". You should restart Openfire when you do.