Use your public domain/hosting as dyn dns.
Author: Carsten Walther
Date: March, 27th 2022
- PHP min. 7.4
- Composer
Download this repository. Make shure you have installed composer. Unzip the package e.g. to /var/www/dyndns/
an run
composer install
Done.
Add a file config.php
into your root folder with the following content:
<?php
const USERNAME = 'username'; // have to be the same in your fritzbox dyndns settings
const PASSWORD = 'password'; // have to be the same in your fritzbox dyndns settings
const PROTOCOL = 'http';
const PORT = '80'; // the port you have opened
const PATH = '/'; // path to your service
At first you have to set port forwarding to make your local server reachable from outsite.
After that you have to add a user defined dyndns.
Add the following data:
Update-URL:
subdomain.yourdomain.com/index.php?mode=update&ipaddr=<ipaddr>&ip6addr=<ip6addr>&username=<username>&pass=<pass>&domain=<domain>
Keep the placeholder in the brackets!
Domainname:
subdomain.yourdomain.com
Domainname is not used at the moment!
Username:
username
Have to be the same like set in your config.php file!
Password:
password
Have to be the same like set in your config.php file!
If everything is done you can run this locally via the build in php webserver for testing purposes. You have to call
php -S localhost:8000
Open your browser and put the assress into the address bar and hit enter.
Then you will be redirected to the correct IP address of your local server.