Neo4j Hosts url resolving to older IP address in the web application after neo4j pods are restarted

I am new to neo4j and I have an application built that talks to neo4j cluster running on kubernetes pods . whenever the neo4j hosts IP address changes i.e whenever the pods are restarted, the application still retries to resolve the hosts url to previous IP address which is no longer there.

I am using
NEO4j server version - neo4j-enterprise-3.4.5
NEO4j driver version - 1.7.5

Is there a way to make the application resolve the IP address dynamically without having to restart the application whenever the Neo4j hosts IP address changes. Please Help

Do you use a persistent connection, or reconnect to the db for each use? BOLT protocol?
Is the correct IP always resolvable by DNS? and are you using a DNS name? (or direct IP)
It would be helpful if you can post the code showing how you are connecting, and additional information about how the connection is used over time (questions above).