Remote access to mysql kodi library

Ok so the thing is I want to set up Kodi library as SQL on my RPi and then make it accessible over internet so I can have synchronized library on all my remote media players (tablets etc.).
I have set up my RPi and made it accessible from internet via DDNS. However I cannot make Kodi connect to SQL by DDNS hostname (in advancedsettings.xml), only by IP…
So my question, is there some way to make Kodi connect to remote library using hostname instead of IP?