If your ISP changes your external IP frequently, a DDNS service might come in handy. I’ve found a simple, cheap and powerful solution to this recently.
There are a lot of different ddns implementations, and a lot of them requires a specific client on your server, which can be really annoying if you don’t run the most popular OS’es or you just don’t trust the random app published by your provider. Another problem can be if the clients restricts the update inteval, and at each IP change you get “blocked” for 5-10 minutes.
Luckily, namecheap (I’m not sponsored in any way) has a better approach: they give you a URL, and you just have to POST request there with your domain name and api key. Then based on the source ip of the request, they set your DNS record. And you can use any type of http client to do this, which is a pretty common tool nowadays.
The url for the service:https://dynamicdns.park-your-domain.com/update\3Fhost=$ddnshos
tname&domain=$ddnsdomain&password=$ddnspass
The hostname variable is your subdomain, “@” if it’s your “main” domain. The pass is the namecheap api key, you can find it on your control panel. You can send post requests periodically to this url in any scripting language. Here’s how it works on MikroTik:
:global ddnshostname "@"
:global ddnsdomain "example.com"
:global ddnspass "<api key here>"
:log info ("DDNS: Updating")
:local str "https://dynamicdns.park-your-domain.com/update\3Fhost=$ddnshostname>
/tool fetch url=($str) mode=https keep-result=no