In 2017 when I setup my first AllStar Node I needed a Dynamic DNS provider as my dynamic IP address keep changing regularly. At the time there were quite a few providers available. I opted for the No-IP provider but I needed software to enable the service. After many days of searching the Internet I found software to be used with Arch Linux. Allstar Node 49355 has since been running from 2017 using No-IP. Recently I wanted to setup a "new" HamVoip installation from scratch. I do have a back-up of the 2017 installation but wanted a different setup for the direct ZS RF Link. I tried to install the noip-duc-linux firmware but it would not install on Arch Linux.
Well searching my backup printed files I found a cryptic note of how I installed ddclient firmware using Arch Linux for HamVoip way back then.
I decided to compile a "How to" for those who would like to setup Dynamic DNS for HamVoip using Arch Linux. I trust that this will be of use to other amateur radio operators still using HamVoip and yes I know that HamVoip has its own DNS server but I prefer to use No-IP for various reasons.
Herewith the setup that worked for me:
Setup Dynamic DNS on Raspberry Pi (HamVoip) using Arch Linux
Before you begin, you will need:
A domain name and an account with a Dynamic DNS provider (e.g., DuckDNS, No-IP, or Cloudflare. I use No-IP.com)
The API key or credentials from your provider for automated updates.
Step
1: Install ddclient
sudo pacman -S
ddclient
Step 2: Configure
ddclient
The configuration file is
located at /etc/ddclient/ddclient.conf
.
Open the configuration file for editing:
sudo nano /etc/ddclient/ddclient.conf
Part of the ddclient.conf file below:
#####################################################
##
## $Id: sample-etc_ddclient.conf 171 2015-01-20 11:57:13Z wimpunk $
##
## Define default global variables with lines like:
## var=value [, var=value]*
## These values will be used for each following host unless overridden
## with a local variable definition.
##
## Define local variables for one or more hosts with:
## var=value [, var=value]* host.and.domain[,host2.and.domain...]
##
## Lines can be continued on the following line by ending the line
## with a \
##
##
## Warning: not all supported routers or dynamic DNS services
## are mentioned here.
##
######################################################################
daemon=300
# check every 300 seconds
syslog=yes
# log update msgs to syslog
mail=root
# mail all msgs to root
mail-failure=root
# mail failed update msgs to root
pid=/var/run/ddclient.pid
# record PID in file.
ssl=yes
# use ssl-support. Works with
# ssl-library
# postscript=script # run script after updating. The
# new IP is added as argument.
#
#use=watchguard-soho, fw=192.168.111.1:80 # via Watchguard's SOHO FW
#use=netopia-r910, fw=192.168.111.1:80 # via Netopia R910 FW
#use=smc-barricade, fw=192.168.123.254:80 # via SMC's Barricade FW
#use=netgear-rt3xx, fw=192.168.0.1:80 # via Netgear's internet FW
#use=linksys, fw=192.168.1.1:80 # via Linksys's internet FW
#use=maxgate-ugate3x00, fw=192.168.0.1:80 # via MaxGate's UGATE-3x00 FW
#use=elsa-lancom-dsl10, fw=10.0.0.254:80 # via ELSA LanCom DSL/10 DSL Router
#use=elsa-lancom-dsl10-ch01, fw=10.0.0.254:80 # via ELSA LanCom DSL/10 DSL Router
#use=elsa-lancom-dsl10-ch02, fw=10.0.0.254:80 # via ELSA LanCom DSL/10 DSL Router
#use=alcatel-stp, fw=10.0.0.138:80 # via Alcatel Speed Touch Pro
#use=xsense-aero, fw=192.168.1.1:80 # via Xsense Aero Router
#use=allnet-1298, fw=192.168.1.1:80 # via AllNet 1298 DSL Router
#use=3com-oc-remote812, fw=192.168.0.254:80 # via 3com OfficeConnect Remote 812
#use=e-tech, fw=192.168.1.1:80 # via E-tech Router
#use=cayman-3220h, fw=192.168.0.1:1080 # via Cayman 3220-H DSL Router
#
#fw-login=admin, fw-password=XXXXXX # FW login and password
#
## To obtain an IP address from FW status page (using fw-login, fw-password)
#use=fw, fw=192.168.1.254/status.htm, fw-skip='IP Address' # found after IP Address
#
## To obtain an IP address from Web status page (using the proxy if defined)
## by default, checkip.dyndns.org is used if you use the dyndns protocol.
## Using use=web is enough to get it working.
## WARNING: set deamon at least to 600 seconds if you use checkip or you could
## get banned from their service.
#use=web, web=checkip.dyndns.org/, web-skip='IP Address' # found after IP Address
#
#use=ip, ip=127.0.0.1 # via static IP's
#use=if, if=eth0 # via interfaces
use=web,web=checkip.dyndns.com/, web-skip='IP Address'
# via web
#
protocol=dyndns2
# default protocol
#proxy=fasthttp.sympatico.ca:80 # default proxy
server=dynupdate.no-ip.com
# default server
#server=members.dyndns.org:8245 # default server (bypassing proxies)
login=
xxxxxxx
# your default login user name
password=
xxxxxxxx
# you default password
zs1iallstar1.ddns.net
#yourhostname
#mx.for.your.host # default MX
#backupmx=yes|no # host is primary MX?
#wildcard=yes|no
Save the file and exit the editor by pressing
Ctrl + X
, thenY
, and thenEnter
.
Step 3: Test the configuration
You
can run ddclient
in a debug mode to test if your configuration is correct and that it
can successfully update your IP address.
sudo ddclient -daemon=0 -noquiet -debug
sudo systemctl status ddclient.service
You
should see output indicating that ddclient
has successfully connected to your provider and updated your DNS
record.
Step
4: Enable and start the ddclient
service
Once
you have a working configuration, you can enable and start the
ddclient
systemd service to have it run automatically.
sudo systemctl enable ddclient.service
sudo systemctl start ddclient.service
ddclient
will now check for and update your public IP address on a regular
basis.
Step 5: Configure port forwarding
For your Raspberry Pi to be accessible from outside your local network, you must configure port forwarding on your router.
Find your Raspberry Pi's local IP address by running
ip a
on the terminal.#ip a
Log in to your router's administration page. The IP address is usually
192.168.1.1
or192.168.
8
.1
.Navigate to the Port Forwarding section. The name and location of this setting vary by router, but it is often under "Advanced," "WAN," or "Network" settings.
Create a new rule to forward the desired external port to your Raspberry Pi's internal IP address and corresponding port.
For SSH: Forward port 222 on the Raspberry Pi's internal IP.
For a web server: Forward ports 80 and 443 to your Raspberry Pi's internal IP.
Step 5: Test your setup
You can test your dynamic DNS configuration and connectivity by using another device outside your network.
Check the DDNS record: Log in to your DDNS provider's website and verify that your domain is now pointing to your current public IP address.
Attempt a connection: Try to SSH into your Raspberry Pi using the hostname you configured with your DDNS provider.