L2tp o PPTP -server with dynamic ip

People , good morning , i have a problem, maybe is a sillyness but meanwhile is a problem, I am working in a two point offices and I want to connect them with a vpn L2TP would be the best but I can work even with PPTP , but the problem is that the command : connect-to= has to be a ip , it doesnt accept an url like office.changeip.net . someone knows how to deal with this? Thanx in advance

You have to write a script and run it from time to time

http://wiki.mikrotik.com/wiki/Manual:Scripting-examples#Resolve_host-name

Thanx , this is the script made for this task : thanks to the support people of mikrotik !
the script :
:local resolvedIP [:resolve “xxxx.changeip.net”];
:local l2tpid [/interface find comment=“l2tpid”];
:local currentIP [/interface l2tp-client get l2tpid connect-to];

:if ($resolvedIP != $currentIP) do={
/interface l2tp-client set l2tpid connect-to=$resolvedIP;
/log info “l2tp ip updated”;
}

Index : l2tpid : is the comment name that I gave to the interface