Blog / How the internet works /

Dynamic DNS explained

If you want to reach something at home from the outside, whether it’s a storage drive, a camera or a small web server, you need an address to point at. Your home connection has one, but as I explained in why your home IP address changes, it isn’t guaranteed to stay the same.

Typing a string of numbers that might be wrong tomorrow is miserable. Dynamic DNS, often shortened to DDNS, is the neat workaround: a name that follows your address around, so you don’t have to.

The idea in one paragraph

Dynamic DNS gives you a normal domain name, like myhome.example.net, and automatically updates the IP address behind it whenever your home address changes. You always connect using the name. The name always points to wherever your home currently is.

An analogy: mail forwarding

Imagine you move house every few months. Instead of telling everyone your new address each time, you keep a mailbox name, “Ekom’s Mail”, and tell the postal service your current address whenever it changes. People write to the name and the post finds you.

Dynamic DNS is that arrangement for your internet connection. The name is the stable thing. The address behind it is the part that moves.

How it works, step by step

  1. You get a hostname from a DDNS service, or you use a name on your own domain through a DNS provider that supports updates.
  2. A small updater runs at home. It’s either built into your router or a little program running on a computer, a NAS or a mini PC.
  3. The updater checks your public address every few minutes.
  4. When the address changes, it tells the DNS provider, which updates the record for your name.
  5. When you connect from outside, your device looks up the name and gets the current address.

It leans on the same lookup mechanism as every website, which I covered in DNS explained for people who just want their site to work. The special ingredient is that the record is updated automatically by a script rather than by hand, and it uses a short TTL so changes take effect quickly. If TTL is unfamiliar, TTL: why DNS changes take time explains it.

Where to get it

You have a few routes:

  • Your router’s built-in DDNS support. Many routers have a “Dynamic DNS” screen that works with a number of services or with the router maker’s own. It’s the easiest option if it fits.
  • A dedicated DDNS provider, which offers free or paid hostnames and update clients.
  • Your own domain with an API-enabled DNS provider. Some DNS hosts let a script update a record through their API. This gives you a tidy name on your own domain, such as home.yourdomain.com. If your DNS runs through a service like Cloudflare, small community scripts can do the updating, and I compared providers in Cloudflare DNS vs your registrar’s DNS.

Whichever you choose, check how the service handles account security, how it notifies you if updates stop, and what happens to free names that go unused.

What it’s good for

  • Remote access to a home server or NAS by name instead of by number
  • A remote desktop or SSH connection to a computer at home
  • Hobby hosting, such as a test site, game server or media server
  • Viewing a camera system that doesn’t use a cloud app
  • A small office with a changing address that wants a stable name for staff

What it can’t fix

CGNAT

If your provider shares one public address between many customers, using carrier-grade NAT, there’s no address of your own to point at. Dynamic DNS will happily update a name to the shared address, and nobody can reach you through it. You’d need a different route, such as a tunnel or a relay service, or a provider that offers a real public address. Check this first, before spending time on setup.

Your router blocking incoming connections

A name pointing at your home isn’t enough. Your router’s firewall still needs to allow the connection, usually through port forwarding to the right device. And opening ports means exposing something to the internet, which is a security decision, not just a convenience.

Delay between change and update

There’s always a small gap. If your address changes at 2:00 and the updater only checks every five minutes, the name may be wrong briefly. Cached answers can add more. For hobby use, it’s fine. For something business-critical, it isn’t a reliable foundation.

Email and serious hosting

Dynamic addresses are a bad base for running a mail server, because many mail systems distrust dynamic home addresses, as discussed in email deliverability for newsletters in a different context. For real websites, rented hosting is more dependable than a home line. Self-hosting for beginners: what is realistic is a good reality check.

Security basics if you use it

Putting a memorable name on your home network makes it easier for you to find, and for others. Take it seriously:

  • Expose as little as possible. Don’t forward ports you don’t need.
  • Keep devices updated. NAS drives and routers are frequently targeted.
  • Use strong, unique passwords and two-factor authentication on anything reachable from the internet.
  • Prefer a VPN into your home over exposing individual services. A VPN server on your router or a small device means only one controlled entry point.
  • Use HTTPS for any web interface, and change default admin logins.
  • Turn off remote admin on the router unless you really need it.

VPNs explained: when you need one and when you do not covers the VPN idea.

Common problems

  • The name points to the wrong address. The updater has stopped, the credentials changed, or the updater sees a different address from the one the internet sees (a sign of CGNAT or a double router setup).
  • Works at home but not outside. Some routers can’t loop traffic back to themselves. Test from mobile data.
  • Works for a while, then stops. Free accounts sometimes need periodic confirmation, and names expire if unused.
  • Your own domain’s record isn’t updating. Check the TTL, the API token permissions and whether the updater logs errors.

Is a static address better?

A static IP is the cleaner solution: a permanent address that never changes, so you don’t need an updater at all. It’s usually an extra cost, and it isn’t offered everywhere. Dynamic DNS is the budget-friendly way to get most of the benefit. Whether you need to pay for the fixed version depends on how important and how public the thing you’re running is.

Key takeaways

  • Dynamic DNS keeps a name pointing at an IP address that changes.
  • A small updater at home tells your DNS provider whenever the address changes.
  • It suits hobby and personal setups, not mission-critical hosting.
  • It can’t get around CGNAT, and it doesn’t open your router for you.
  • Expose as little as you can, and protect what you do expose.

Before you set anything up, check whether the public address your router shows matches the one a “what is my IP” site reports. If they differ, you’re likely behind CGNAT, and dynamic DNS won’t help.