Ddns in config files

When I first installed Apache, Nextcloud and created Self-Signed SSL Certificate I set my public IP in servername as I don’t have a domain. I have DHCP from my ISP so I had to get a ddns. I decided to go with dynu.com. The config files I set my IP is:
servername My_IP

Redirect permanent "/" "https://My_IP/"

ServerName "My_IP"

When installing the Self-Signed SSL Certificate I put my IP in:
"Common Name (e.g. server FQDN or YOUR name) []"

If my DHCP IP from my ISP change, will my Nextcloud stop working? If it do, can I add my dynu.com instead where I have set my IP from my ISP? I’m also worried about the Self-Signed SSL Certificate as I cant find any conf file to edit my IP. I’m guessing I have to make a new certificate? I’m a bit scared to edit those file as my wife already started to use Nextcloud for important school work.

I’m using Ubuntu Server and used the guide from DigitalOcean
Hope you can help me
I canged the IP to my dynu.com and it works.

You usually take host names for the certificates. If you have your own domain, you can create a cname record for the dyndns-hostname which would allow you to use a free, public ssl certificate from letsencrypt.com.