-
Notifications
You must be signed in to change notification settings - Fork 62
Create a DNS domain hostname
You can choose any of these websites:
Important
In this guide, logs and scripts(cron job) path are set to save in, or point at Pi's home directory/home/pi
.
For examples, in:
echo url="https://api.dynu.com/nic/update?username=USERNAME&password=PASSWORD" | curl -k -o /home/pi/dynu.log -K -
*/5 * * * * sudo /home/pi/dynu.sh >/dev/null 2>&1
If using other OS, change the location - /home/pi
. For example in Ubuntu is home/YourUsername
.
Tip
To check any system's home directory path, Simply type the following command:
echo $HOME
-
Create account at https://www.dynu.com/en-US/ControlPanel/CreateAccount/
-
Go to https://www.dynu.com/en-US/ControlPanel/DDNS/ and select add domain
- Enter any name in host and select a domain in top level options for example :
trinibvpn.freeddns.org
- Need to install DDclient to update external IPv4 address when it changes:
sudo apt-get install ddclient -y
It will show to a setup screen, keep pressing enter until installation is done.
- Open DDclient configuration file:
sudo nano /etc/ddclient.conf
- Copy&Paste text below, just change to your username, password, domain name:
# ddclient configuration for Dynu
#
# /etc/ddclient.conf
# Check every 5 minutes
daemon=600
# Log update msgs to syslog
syslog=no
# Record PID in file
pid=/var/run/ddclient.pid
# Get ip from server
use=web, web=checkip.dynu.com/, web-skip='IP Address'
# IP update server
server=api.dynu.com
protocol=dyndns2
# Your info
login=USERNAME
password=PASSWORD
DOMAINNAME
- Put all the parameters in the configuration file before running DDclient:
sudo /usr/sbin/ddclient -daemon 300 -syslog
- Start DDclient daemon:
sudo systemctl restart ddclient && sudo systemctl start ddclient
Reboot router and check in dynu control panel to see if IPv4 updated. (keep note on the last external IP you had or manually change it to something random in dynu settings before)
Need to use a update URL
command script method for IPv6 because DDclient can only update one record (A or AAA) at a time according to docs.
- Need to create a script file to update dns service:
sudo nano dynu.sh
- Copy&Paste this line but with your own username and passowrd:
echo url="https://api.dynu.com/nic/update?username=USERNAME&password=PASSWORD" | curl -k -o /home/pi/dynu.log -K -
- Set permission to the file:
sudo chmod 700 dynu.sh
- Run this command to check if dynudns updated. Go to https://www.dynu.com/en-US/ControlPanel/DDNS/ and under
LAST UPDATED
, you will see time updated.
sudo /home/pi/dynu.sh
- Use a cron job to make the script run every 5 minutes:
crontab -e
- Add the following at the bottom of crontab:
*/5 * * * * sudo /home/pi/dynu.sh >/dev/null 2>&1
DONE !
-
Create account at https://freedns.afraid.org/
-
Click on “Add a subdomain” on the left and enter any subdomain name and pick any domain, but for destination put
0.0.0.0
to check if your external IP updates.
- Create a script to update external IP address when it changes:
sudo nano free.sh
- Copy&Paste this line but with your token:
echo url="https://freedns.afraid.org/dynamic/update.php?YOURTOKEN" | curl -k -o /home/pi/free.log -K -
- To get token go to https://freedns.afraid.org/dynamic/ and click
direct url
at the botton.At the end of the link in address bar you will see token
- Set permission to the file :
sudo chmod 700 free.sh
- Run this command to check if freedns updated. Go to https://freedns.afraid.org/subdomain/ and check if destination option changed to your external IP(both records are updated A and AAA).
sudo /home/pi/free.sh
- Use a cron job to make the script run every 5 minutes
crontab -e
- Add the following at the bottom of crontab:
*/5 * * * * sudo /home/pi/free.sh >/dev/null 2>&1
- Use DDclient instead to update IP for freedns.afraid.org, copy&paste text below in /etc/ddclient.conf:
daemon=5m
timeout=10
syslog=no # 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
use=if, if=eth0
server=freedns.afraid.org
protocol=freedns
login=YOUR FREEDNS LOGIN
password=YOUR FREEDNS PASSWORD
your.freedns.domain
- Use cron script
New
Cron script(Update Interface v2) recently added [click here]
DONE !
-
Create account at https://www.duckdns.org/
-
Verfy reCAPTCHA and add any domain name
- Create a script to update DNS service:
sudo nano duck.sh
- Copy&Paste this line but with your own domain name and token :
echo url="https://www.duckdns.org/update?domains=YOURDOMAIN&token=YOURVALUE" | curl -k -o /home/pi/duck.log -K -
- Get token on the site main page
- Set permission to the file :
sudo chmod 700 duck.sh
- Run this command to check if duckdns updated. Go to https://www.duckdns.org/ and under
CHANGED
, you will see time updated
sudo /home/pi/duck.sh
- Use a cron job to make the script run every 5 minutes
sudo crontab -e
- Add the following at the bottom of crontab:
*/5 * * * * sudo /home/pi/duck.sh >/dev/null 2>&1
DONE !