How to update 'IP address appears to have changed' automatically?

Hi i’m Running Virtualmin on Ubuntu within Windows WSL2. Every time I restart my machine/WSL the IP address of WSL2 changes, which is not great but is fine as its expected (WSL2 flaw no static IP).

When I startup Webmin ‘sudo services webmin start’ and then login via the browser I get the warning: ‘Warning! Your system’s primary IP address appears to have changed from (IP address) to (IP address)’

I click ‘update IP addresses’ for both of my virtual servers, start APACHE2 and MYSQL and it works fine.

So my question:
How can I automate this process so I don’t have to click ‘update IP addresses’ and Virtualmin just does this automatically every time it starts up for my virtual servers?

I will be forever in your debt as this issue has consumed a lot of my time so far.



Duplicate of: How to update changed IP Address automatically?