Coder Social home page Coder Social logo

php-dyndns's Introduction

php-dyndns

SchlundTech DynDNS backend for PHP.

Installation

Prerequisites

  • Contract with Schlund-Technologies and access to the XML-Gateway.
  • Webserver with PHP and php-curl (optional, runs from CLI as well).

Setup

  1. Create a subdomain with an A-record in your domain, say home.example.com. It should have a low TTL value such that it is not cached (schlundtech only allows >=60).
  2. Upload the files to your webserver. The update.php script has to be accessible from the web, for example: dyndns.example.com/update.php. HTTPS is highly recommended!
  3. Copy config.example.php to config.php and adjust the settings.
  4. Create the logdir and give the webserver write-access to it.
  5. Set up a cron-job, fritz-box, router, ... to do a request every time the ip-address changes. The URL is http://dyndns.example.com/update.php?pass=<password>&domain=example.com&ipaddr=<ipaddr>&ip6addr=<ip6addr>

NGINX configuration

This is an example configuration for nginx:

server {
  # your settings

  location ~ /\.git {
    deny all;
  }

  location ~ ^/config.*.php { deny all; }
  location ~ ^/request-get.xml { deny all; }
  location ~ ^/request-put.xml  { deny all; }
  location ~ ^/logs/  { deny all; }
}

Command line

The script can also be executed from the command line:

php update.php --pass="<password>" --domain="example.com" --ipaddr="<ipaddr>" --ip6addr="<ip6addr>"

Roadmap

  • Standardize API, e.g. like Dyn.com
  • Security-Audit
  • Rolling log files

php-dyndns's People

Contributors

martinlowinski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-dyndns's Issues

Log DDNS requests

In a comment on my blog post ValiDOM pointed out, that logging all valid DDNS requests on the server would be a nice feature. In case of inquiries from the law enforcement this could come in handy.

He also submitted some code, comments and reviews are welcome.

It is only the last entry in the multi-domain function transmitted

Hello Martin,

i try to use your script, but it only the single-domain function. The multi-domain function is not working. That script transmits only the last entry.

I have only one domain, but there multiple subdomains.

For example:

define('DOMAINS', serialize(array("example.com" => "home", "example.com" => "admin")));

Submitted but then only the entry admin.

Another example:

define('DOMAINS', serialize(array("example.com" => "admin", "example.com" => "whatever", "example.com" => "test2", "example.com" => "test", "example.com" => "home")));

Submitted but then only the entry home.

Do you have any idea where is the problem?

Strange Behavior

Hello,

i used you system for a long time.
Now i had to change to another server. And hat to start from scratch.
Unfortunately i now get several errors.
I used all the latest file.

But at the moment i get the following response.

2017-05-10T20:15:57+02:00 NOTICE [1024]: get current zone records
2017-05-10T20:15:58+02:00 NOTICE [1024]: <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<response>
  <result>
    <data/>
    <msg>
      <text>Diese Zone ist bisher nicht eingetragen.</text>
      <code>EF02020</code>
      <type>error</type>
      <object>
        <type>zone</type>
        <value>xxx.net</value>
      </object>
    </msg>
    <status>
      <code>E0205</code>
      <text>Zoneninformationen konnten nicht ermittelt werden.</text>
      <type>error</type>
      <object>
        <type>zone</type>
        <value>xxx.net</value>
      </object>
    </status>
  </result>
  <stid>20170510-app3-179403</stid>
</response>

The Zone is configured and worked for months.
Perhaps this is the result of the following error.
PHP Fatal error: Uncaught Error: Call to a member function removeChild() on null in /var/www/clients/client1/web5/web/xxx/update.php:123\nStack trace:\n#0 {main}\n thrown in /var/www/clients/client1/web5/web/xxx/update.php on line 123

Any Hint or help would be useful.
I tried it with a single subdomain and 'DOMAIN' and 'DOMAINS'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.