Sometimes when sharing a link in owncloud, especially on the mobile and desktop clients, the links are using the IP address instead of the DNS name.
This behavior can be changed by using the overwritehost parameter in the config.php file included inside /var/www/owncloud/config folder.
So, for example, if you are using the DNS name cloud.storage.com, then you should add the parameter as follows:
‘overwritehost‘ => ‘cloud.storage.com‘,