Nextcloud version (eg, 20.0.5): Nextcloud Hub II (23.0.0)
Operating system and version (eg, Ubuntu 20.04): 20.04.3 LTS
Apache or nginx version (eg, Apache 2.4.25): 2.4.41
PHP version: ‘7.4.3’
Log into (or Secure Shell into) your server hosting Nextcloud. Open the necessary configuration file with the command:
sudo nano /var/www/html/nextcloud/config/config.php
In that file, you should see the line:
0 => IP_1
Where IP_1 is the original IP address of your Nextcloud server.
Add a new line below, like so:
1 => IP_2
Where IP_2 is the new IP address of the Nextcloud server.
The end result should have both old and new IP addresses listed (Figure A).
Ready to log in
After you save and close the config.php file, you should now be able to go back to your Nextcloud instance without the Trusted Domain issue preventing logins. There's no need to restart Nextcloud or the hosting server. That's all there is to resolving this particular issue. Just remember, if you change the IP address of your server again, you'll need to add the new address to the config.php file.