Owncloud – You are accessing the server from an untrusted domain

Suddenly ownCloud gives me an error “You are accessing the server from an untrusted domain. Please contact your administrator”. When you go to the webpage and when I click on the “add as truted domain” it gives me a timeout error.

My ISP provided me with a dynamic IP address, in my case the WAN IP address changed. ownCloud remembers the IP address or host name originally used. To fix this error you need to replace the old IP address used with a new one or add an additional IP addresses or domains.


I am running ownCloud instance from Ubuntu 14.04. Access Terminal enter the following command:

gksu gedit /var/www/owncloud/config/config.php

you can also use the following command:

nano /usr/share/owncloud/config/config.php


We can edit the the config.php to replace the IP address or domain name to include your domain. Locate the section “trusted domains“, change the IP address or domain name to your new domain. It may look similar to this:

'trusted_domains' =>
 array (
 0 => '',

You can change it to include your new IP address by changing the IP value or you can add additional addresses. For example:

'trusted_domains' =>
 array (
 0 => '','servername.example.com',

also change the url’ => http to the new IP address or domain name.


Then save your changes. If you used the nano command press Ctrl+o and then press enter to accept the name of the file. Press Ctrl+x to exit nano and re-test access.

Video Tutorial:


I started this tech blog back in 2011 as a place to write down processes I took to fix my client systems and network. Now I write some tips and tricks to help others with the tech issues that one might encounter.

You may also like...