Create a Home Server without static IP

Aziz Fikri Mahmudi
3 min readJun 13, 2023

--

Image by full vector on Freepik

Have you guys wondered? Is it possible to create a private server without static IP? ABSOLUTELY!

As you guys know, there are services that can help us manage our DNS using our public IP even though we don’t have a static public IP address. For the past 2 weeks, I’ve been wondering how these services work.

What do they do so they can keep my IP address up to date in the DNS server?

How do they check and update my public IP address?

etc…

After doing some kind of research, I learned that services like No-IP periodically check our current public IP address and if the IP address is changed they would change our DNS record in the DNS server. By doing these they can keep our DNS record up to date with our current public IP. And some routers include setting in their firmware to help us use DDNS providers.

For example, my router has a built-in menu to setup DDNS easily

There are providers like DynDNS, DtDNS, No-IP, and EasyDNS that my router supports.

Unfortunately, if we use a DDNS provider like No-IP, we can only use their provided domain name if we want to use the free service. If we want to use our domain it’ll cost at least $20 a month and it does not include the domain price (CMIIW). If other options make it possible with just a small price and can do a lot of things out of it, I’ll choose it!

Fortunately, we can just simply create our script to periodically update our public IP address in our DNS provider. There are a few steps to getting this thing done, but it is worth the effort. The steps are like this,

  1. Setup Port Forwarding and DNS
  2. Automatically update the DNS Record

The process of periodically updating our record is more or less like this diagram below,

It is as simple as storing a value in the database, but instead of using our database, we call an API that was provided by our provider to save the new record. We need to make this behavior automatically execute every x seconds. I’ll cover any other things in the upcoming stories, stay tuned!

Okay! Let’s keep things short and end the story here! See you guys again in the next stories!

ps: I was able to set up mine, so make sure to stay until the end!

--

--

Aziz Fikri Mahmudi

Passionate Backend Engineer | Backend Engineer at Amartha