Dynamic DNS update script (Namecheap)

  • Just wanted to share a Bash script for dynamic update of DNS addresses at Namecheap registrar.

    This scripts require CURL ---> apt-get install curl.


    I have also added 2 scripts for Systemd cron style to call the update script on regular intervals. you can ofcourse call the script with a regular CRON if you want.


    This script work behind a NAT/Router with internal IP


    ddns_update.sh

    SystemD - ddns.service

    Code
    [Unit]
    Description=Dynamic DNS update
    
    [Service]
    User=root
    ExecStart=/usr/local/etc/ddns_update.sh >/dev/null
    
    [Install]
    WantedBy=basic.target

    Systemd - ddns.timer

    Code
    [Unit]
    Description=Run Dynamic DNS update every 5 min
    
    [Timer]
    OnBootSec=2min
    OnUnitActiveSec=5min
    Unit=ddns.service
    
    [Install]
    WantedBy=timers.target


    Please enjoy the best possible solution to update your dynamic domains from behind a router/NAT..


    Prilly

  • master G

    Added the Label Article

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!