Hello,
It depends :-)
In essence, your CN should match what you're calling IP address or DNS.
If the cert does not have IP address inside (and it's rarely the case), you just make sure that corresponding DNS A record changes after the IP address changes and you should be fine.
M.