This answer from @steevej shows how to lookup your hosts from the mongodb+srv uri.
From there resolve the hosts returned in the SRV records.
Do to the cloudy nature of Atlas I do not think you have any guarantees of the ips remaining as they are over the clusters lifetime. Happy to be corrected here.
This outline when the IPs change and when they do not.