I haven’t seen reports about Spark being more stable using IP than a domain name. But actually nobody would want to use it with IP as it would create problems in XMPP. You can check the logs on Spark and on the server (Openfire i presume) at the time it disconnects.
Spark logs are at C:\Users\User\AppData\Roaming\Spark\logs\ (there are a lot of separate files, check all of them and look for events of relevant date and time)
Openfire logs are at Openfire\logs\all.log
Also, as an experiment you can try putting domain name into domain field, but then go to Advanced menu on Spark’s login screen, uncheck the Automatically discover host and port and put IP there. See how it works this way.