DDNS and you

DDNS and you
Banff

When self-hosting a website such as a blog or a static portfolio you need to be able to translate domain queries to your public IP address. A DNS (Domain Name System) will translate to a static IP address that will need to be manually updated if the target IP address is ever changed. A DDNS (Dynamic Domain Name System) are usually updated through automation, if you are self-hosting and your ISP does not give you a static IP then you will want to go the DDNS route.


In my case my provider will not give me a static IP because I'm not paying those big business bucks. Instead, for personal uses I'm assigned an IP address that can change every few days, so it's important that the domain name points to the correct IP address. For the automation of updating the DDNS record I've been using the Docker container qmcgaw/ddns-updater for that purpose. It's a pretty simple and low resource cost container and it uses a config.json for configuration.

This steps out line on the Docker hub are pretty easy to understand, but once again I'll be posting my configuration that relies on frontend network being on the same network as Nginx. For extra layer of protection I don't expose the ports to the internet. Port 8002 isn't forwarded through any firewalls, so it should be safe behind my network firewall in principle.


version: '3.7'

networks:  
  frontend:    
    external: 
      true 
services:  
  app:  
    image: qmcgaw/ddns-updater:latest    
    container_name: ddns-updater-app    
    restart: always    
    ports:      
      - 8002:8002 # exposes 8002 to your network but not to the WAN.
    environment:     
     - PERIOD=10m # A 10min period between checks     
     - UPDATE_COOLDOWN_PERIOD=10m # A cooldown after between each update helpful to not being rate limited or banned.     
     - HTTP_TIMEOUT=30s    
     - LISTENING_PORT=8002
     - TZ=America/Edmonton
     - PUBLICIP_FETCHERS=all
     - PUBLICIP_HTTP_PROVIDERS=all
     - PUBLICIPV4_HTTP_PROVIDERS=all
     - PUBLICIPV6_HTTP_PROVIDERS=all      - PUBLICIP_DNS_PROVIDERS=all      - BACKUP_PERIOD=24h # Makes a backup of your configuration every 24 hours.      - BACKUP_DIRECTORY=/updater/data    volumes:      - /yourpath/ddns-updater/data:/updater/data    networks:      - frontend

An example of the config.json would look like the following, if you were using google domains as your registrar. The config.json no matter who is your provider, would sit inside the ddns-updater/data folder.

{  
  "settings": [    
    {      
      "provider": "google",      
      "domain": "armoredcore.jp",      
      "host": "@",      
      "username": "5YAoerW2DATWTE",      
      "password": "fMmkczCZDP9rfxmQ",      
      "ip_version": "ipv4"     
    },    
    {      
      "provider": "google",      
      "domain": "armoredcore.jp",      
      "host": "6",      
      "username": "z4dAWtzgiPt9FfKY",      
      "password": "s26hbrLCYbDRRZWG",      
      "ip_version": "ipv4"     
    },
    {      
      "provider": "google",      
      "domain": "armoredcore.jp",      
      "host": "vi",      
      "username": "9L2UU8tCGhxo58KF",      
      "password": "kEgL6pbX7BGsREh2",      
      "ip_version": "ipv4"     
    }  
  ]
}
Armored Core 6 BABY!!!

Above will update the following domains and subdomains: armoredcore.jp, 6.armoredcore.jp, and vi.amoredcore.jp. We can have multiple domain providers inside the configuration file. To find your configuration please visit: ddns-updater's page about domain configuration. Once this is all setup you'll have a working DDNS updater!