VPN does not work with Cloud DDNS

Hello guys.
I have a VPN (L2TP) between a headquarters and a branch offic that works perfectly with the public IP address.
When I set the native DDNS Cloud of Mikrotik the status is connecting.
I have to use a DDNS because the public IP address is dynamic.
Is there any rule or script how this can be done? I’m a rookie in mikrotik.
Thanks.

Look at the images below

https://uploaddeimagens.com.br/imagens/hHujCuA
https://uploaddeimagens.com.br/imagens/_sKvtg8

  • Check IP of your DDNS domain is the same as your public IP.
  • Enable debug logging both on client and server and look which part of VPN communication have issues.

Yes, it’s the same IP address.
I’ll look for a tutorial on how to enable this debug logging. Thanks.

You’ll need to enable debug for “ipsec” and “l2tp” topics.
https://help.mikrotik.com/docs/display/ROS/Log

Mate, the message was: -

Topics: l2tp
ppp
info
Message: could not resolve name

Interisting cause, when i set the public ip address it does work.

DNS problems, i set the correct DNS server and ALL WORK JUST FINE.
Thank u sooo much, mate.

Thank you for posting feedback! I am glad I was able to help you.