Want to attach your home server to a subdomain but don't know how? Use this simple PHP script with a cronjob to dynamically update your DNS records!
ssh to your home server and make sure deps are installed, such as php php-curl
.
# git clone https://github.com/shoaloak/DirectAdmin-DDNS /opt/dyndns
# vi /opt/dyndns/credentials.json
# cat /opt/dyndns/credentials.json
{
"username": "myusername",
"password": "mypassword",
"hostname": "webXXXX.zxcs.nl",
"domain": "mydomain.com",
"subdomain": "mysubdomain"
}
# whereis php # <php location>, usually /usr/bin/php
# crontab -e
* * * * * <php location> /opt/dyndns/dyndns.php
- Based on this forum post.
- Shamelessly mirroring httpsocket.php