Tags: scripts-and-functions no-ip
The source for the noiphp (no-ip php) can be found at:
http://github.com/diversen/noiphp
It is a simple PHP5 script for using the no-ip.com API for updating DNS for hosts that does not have a static IP address. E.g. some broadband DSL connection switches IP every day.
The no-ip API is quite simple. And it is useful in many situations. E.g. you have an address on your home network, one in the train, and one when you are on work.
Requirements: You will need the php5-cli and you will need the php5-curl extension enabled
Only tested on Linux (Ubuntu)
git clone http://github.com/diversen/noiphp
cd noiphp
You will need to first sign up, and create a domain name. You will now have an email and a password and at least one domain name.
cp config/config.php-dist config/config.php
Set settings (email, password, domains(s), API base URL). e.g:
vim config/config.php
Optional: Add api_ip
for allowing to set a different URL where we can get your current IP, which is then used to send to the no-ip service. You can just leave this one empty and the following will be used:
http://www.os-cms.net/api/your_addr.php
The URL above just echoes your machines current IP, which is then read and sent to the no-ip API.
That's it!
Run:
php run.php
run
crontab -e
Add a line that will run the script e.g. every 5 minute (set to your own path of the run.php script):
*/5 * * * * php /home/dennis/noiphp/run.php
Logs are saved to logs/coscms.log
This page has been requested 14884 times