Difference between revisions of "5.0-Nano: DtDNS"

From The Uniform Server Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
 +
----
 +
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 +
----
 +
=[http://ekygelymib.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=
 +
----
 +
=[http://ekygelymib.co.cc CLICK HERE]=
 +
----
 +
</div>
 
{{Nav 5.0-Nano}}
 
{{Nav 5.0-Nano}}
 
'''Uniform Server and DtDNS'''
 
'''Uniform Server and DtDNS'''
Line 19: Line 27:
 
There are two pages to fill in, enter the following details:
 
There are two pages to fill in, enter the following details:
 
{|
 
{|
|&nbsp;||'''''Page 1'':'''||&nbsp;
+
|&amp;nbsp;||'''''Page 1'':'''||&amp;nbsp;
 
|-
 
|-
 
|1)||'''Desired Username'''||This name is used for logging into your '''account'''
 
|1)||'''Desired Username'''||This name is used for logging into your '''account'''
Line 37: Line 45:
 
|8)||'''Two CAPCHA words'''||Enter the two CAPCHA words (if these are difficult to read click the new challenge button)  
 
|8)||'''Two CAPCHA words'''||Enter the two CAPCHA words (if these are difficult to read click the new challenge button)  
 
|-
 
|-
|&nbsp;||'''''Page 2'':'''||&nbsp;
+
|&amp;nbsp;||'''''Page 2'':'''||&amp;nbsp;
 
|-
 
|-
 
|9)||'''Username'''||Enter your Username as entered in '''1)'''.
 
|9)||'''Username'''||Enter your Username as entered in '''1)'''.
Line 49: Line 57:
 
'''''General information'':'''
 
'''''General information'':'''
 
{|
 
{|
|-valign="top"
+
|-valign=&quot;top&quot;
 
|
 
|
 
*A DtDNS account is limited to '''five free''' hostnames.
 
*A DtDNS account is limited to '''five free''' hostnames.
 
* A hostname is concatenated with a '''domain''' name.
 
* A hostname is concatenated with a '''domain''' name.
* I have listed available domains on the right.<br /><br />
+
* I have listed available domains on the right.&lt;br /&gt;&lt;br /&gt;
 
* Your full URL for example
 
* Your full URL for example
 
** If you chose '''books''' as hostname
 
** If you chose '''books''' as hostname
Line 60: Line 68:
 
Will look like this:
 
Will look like this:
  
'''<nowiki>http://</nowiki>books.effers.com'''     
+
'''&lt;nowiki&gt;http://&lt;/nowiki&gt;books.effers.com'''     
 
|
 
|
&nbsp;&nbsp;
+
&amp;nbsp;&amp;nbsp;
 
|
 
|
 
{|
 
{|
Line 69: Line 77:
 
|-
 
|-
 
|
 
|
<pre>
+
&lt;pre&gt;
 
3d-game.com
 
3d-game.com
 
4irc.com
 
4irc.com
Line 79: Line 87:
 
dtdns.net
 
dtdns.net
 
effers.com
 
effers.com
</pre>
+
&lt;/pre&gt;
 
|
 
|
<pre>
+
&lt;pre&gt;
 
etowns.net
 
etowns.net
 
etowns.org
 
etowns.org
Line 91: Line 99:
 
suroot.com
 
suroot.com
  
</pre>
+
&lt;/pre&gt;
 
|}
 
|}
 
|}
 
|}
Line 98: Line 106:
 
After creating a hostname wild cards are enabled by default. This allows you to use a URL such as  
 
After creating a hostname wild cards are enabled by default. This allows you to use a URL such as  
  
<nowiki>http://</nowiki>'''www.'''books.effers.com - Note '''www.''' is the wild card part this can be anything you like for example:
+
&lt;nowiki&gt;http://&lt;/nowiki&gt;'''www.'''books.effers.com - Note '''www.''' is the wild card part this can be anything you like for example:
  
* <nowiki>http://</nowiki>www.'''books.effers.com'''
+
* &lt;nowiki&gt;http://&lt;/nowiki&gt;www.'''books.effers.com'''
* <nowiki>http://</nowiki>www-internation.'''books.effers.com'''
+
* &lt;nowiki&gt;http://&lt;/nowiki&gt;www-internation.'''books.effers.com'''
* <nowiki>http://</nowiki>local.'''books.effers.com'''
+
* &lt;nowiki&gt;http://&lt;/nowiki&gt;local.'''books.effers.com'''
* <nowiki>http://</nowiki>www.home.'''books.effers.com'''
+
* &lt;nowiki&gt;http://&lt;/nowiki&gt;www.home.'''books.effers.com'''
  
 
'''books.effers.com''' resolves to your IP address you can use the wild card on your server to resolve to different sites.
 
'''books.effers.com''' resolves to your IP address you can use the wild card on your server to resolve to different sites.
Line 128: Line 136:
 
To manage existing hostnames, simply click the entry in the list for example see below.
 
To manage existing hostnames, simply click the entry in the list for example see below.
  
{|cellspacing="6"
+
{|cellspacing=&quot;6&quot;
 
|-
 
|-
 
|'''Hostname'''||'''Domain'''||'''IP Address'''||'''Type'''
 
|'''Hostname'''||'''Domain'''||'''IP Address'''||'''Type'''
Line 148: Line 156:
 
In the user configuration section locate these lines:
 
In the user configuration section locate these lines:
  
* $id_pw[] = "'''books.effers.com''','''fred123'''";  // Change
+
* $id_pw[] = &quot;'''books.effers.com''','''fred123'''&quot;;  // Change
* $id_pw[] = "'''books.effers.com''','''fred123'''";  // Change or delete
+
* $id_pw[] = &quot;'''books.effers.com''','''fred123'''&quot;;  // Change or delete
* $id_pw[] = "'''books.effers.com''','''fred123'''";  // Change or delete
+
* $id_pw[] = &quot;'''books.effers.com''','''fred123'''&quot;;  // Change or delete
 
Substitute '''books.effers.com''' with your real host and domain names, replace the password '''fred123''' with the one you set in step 1)
 
Substitute '''books.effers.com''' with your real host and domain names, replace the password '''fred123''' with the one you set in step 1)
  
Line 158: Line 166:
 
|-
 
|-
 
|
 
|
<pre>
+
&lt;pre&gt;
<?php
+
&lt;?php
 
/*
 
/*
 
###############################################################################
 
###############################################################################
Line 172: Line 180:
  
 
chdir(dirname(__FILE__)); // Change wd to this files location
 
chdir(dirname(__FILE__)); // Change wd to this files location
include_once "../../unicon/main/includes/config.inc.php";
+
include_once &quot;../../unicon/main/includes/config.inc.php&quot;;
include_once "../../unicon/main/includes/functions.php";
+
include_once &quot;../../unicon/main/includes/functions.php&quot;;
  
 
run_location_tracker();  // Have servers moved if moved update configuration
 
run_location_tracker();  // Have servers moved if moved update configuration
print"\n";
+
print&quot;\n&quot;;
  
 
//######################## User Configuration #################################
 
//######################## User Configuration #################################
 
// Add as many lines as required with the following format:
 
// Add as many lines as required with the following format:
//  $id_pw[] = "hostname,password";
+
//  $id_pw[] = &quot;hostname,password&quot;;
 
// For example:
 
// For example:
// $id_pw[] = "books.effers.com,fred123";
+
// $id_pw[] = &quot;books.effers.com,fred123&quot;;
// $id_pw[] = "power.dtdns.net,gun22powder";
+
// $id_pw[] = &quot;power.dtdns.net,gun22powder&quot;;
 
//-----------------------------------------------------------------------------
 
//-----------------------------------------------------------------------------
  
$id_pw[] = "books.effers.com,fred123";  // Change
+
$id_pw[] = &quot;books.effers.com,fred123&quot;;  // Change
$id_pw[] = "books.effers.com,fred123";  // Change or delete
+
$id_pw[] = &quot;books.effers.com,fred123&quot;;  // Change or delete
$id_pw[] = "books.effers.com,fred123";  // Change or delete
+
$id_pw[] = &quot;books.effers.com,fred123&quot;;  // Change or delete
  
 
//###################### END User Configuration ###############################
 
//###################### END User Configuration ###############################
Line 196: Line 204:
  
 
foreach ($id_pw as $value) {                        // Iteratate through array
 
foreach ($id_pw as $value) {                        // Iteratate through array
   $idpw_array = explode(",",$value);                // Split id pw pairs
+
   $idpw_array = explode(&quot;,&quot;,$value);                // Split id pw pairs
  
 
   if(get_ip_dns($idpw_array[0])){                  // Was IP from DNS returned
 
   if(get_ip_dns($idpw_array[0])){                  // Was IP from DNS returned
Line 202: Line 210:
  
 
       if($test){ // Test code
 
       if($test){ // Test code
       print "DNS IP = $ip_dns CURRENT IP = $ip_current $idpw_array[0]<br/>\n";
+
       print &quot;DNS IP = $ip_dns CURRENT IP = $ip_current $idpw_array[0]&lt;br/&gt;\n&quot;;
 
       }
 
       }
  
Line 242: Line 250:
  
 
// Build complete URL
 
// Build complete URL
$str= $url."?id=".$id_val."&pw=".$pw_val."&client=".$client_val;
+
$str= $url.&quot;?id=&quot;.$id_val.&quot;&amp;pw=&quot;.$pw_val.&quot;&amp;client=&quot;.$client_val;
  
 
// Access page using Curl SSL
 
// Access page using Curl SSL
Line 254: Line 262:
  
 
// Test returned page  
 
// Test returned page  
if(preg_match("/now\spoints\sto/",$buffer)){// Is returne value "now points to"
+
if(preg_match(&quot;/now\spoints\sto/&quot;,$buffer)){// Is returne value &quot;now points to&quot;
 
  return true;                              // yes: update OK
 
  return true;                              // yes: update OK
 
}
 
}
Line 262: Line 270:
 
}
 
}
 
//============================================== END DtDNS Host Update Page ===
 
//============================================== END DtDNS Host Update Page ===
?>
+
?&gt;
</pre>
+
&lt;/pre&gt;
 
|}
 
|}
 
'''''[[#top | Top]]'''''
 
'''''[[#top | Top]]'''''
Line 275: Line 283:
  
 
Contains:
 
Contains:
<pre>
+
&lt;pre&gt;
 
COLOR B0
 
COLOR B0
 
@echo off
 
@echo off
Line 289: Line 297:
 
popd
 
popd
 
EXIT
 
EXIT
</pre>
+
&lt;/pre&gt;
 
'''''[[#top | Top]]'''''
 
'''''[[#top | Top]]'''''
 
=== Cron - Automatic update ===
 
=== Cron - Automatic update ===
Line 299: Line 307:
  
 
Locate these two line in section '''List of scripts to be run'''
 
Locate these two line in section '''List of scripts to be run'''
<pre>
+
&lt;pre&gt;
 
   // $cmd = 'start ..\..\usr\local\php\php-win.exe ..\..\plugins\dtdns_updater\dtdns_updater.php';
 
   // $cmd = 'start ..\..\usr\local\php\php-win.exe ..\..\plugins\dtdns_updater\dtdns_updater.php';
 
   // pclose(popen($cmd,'r'));            // Start detatched process   
 
   // pclose(popen($cmd,'r'));            // Start detatched process   
</pre>
+
&lt;/pre&gt;
 
and uncomment as shown below
 
and uncomment as shown below
<pre>
+
&lt;pre&gt;
 
   $cmd = 'start ..\..\usr\local\php\php-win.exe ..\..\plugins\dtdns_updater\dtdns_updater.php';
 
   $cmd = 'start ..\..\usr\local\php\php-win.exe ..\..\plugins\dtdns_updater\dtdns_updater.php';
 
   pclose(popen($cmd,'r'));            // Start detatched process   
 
   pclose(popen($cmd,'r'));            // Start detatched process   
</pre>
+
&lt;/pre&gt;
 
'''''Notes'':'''
 
'''''Notes'':'''
 
* When the server is first started Cron is run and the IP addreess updated if different
 
* When the server is first started Cron is run and the IP addreess updated if different

Revision as of 10:22, 24 November 2010



This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page


CLICK HERE


 

Uniform Server and DtDNS

Majority of domestic Internet connections are via a dynamic IP address, one that changes every time you connect to the Internet. This means you cannot run a web server unless you purchase a, static IP address from your ISP (Internet service provider). Even with a static IP you require and entry in a DNS server that converts your domain name into this IP address allowing other users to access your server.

An alternative is to use a free service such as DtDNS they provide accounts that allow you to obtain a domain name and tracking software to automatically update your IP address as it changes. A big advantage of their free service they automatically enable Wild cards by default.

Uniform Server supports the DtDNS service by integrating a, simple PHP scrip to automatically update hostname IP address at DtDNS. Script is configurable allowing you to update all five free hostnames. The script can optionally be run by cron making the whole task transparent.

Note: The script is portable hence popping the servers on a USB memory stick means you can have them on-line and accessible within ten minutes (DNS propergation time) if new PC host has been configured to allow Internet server traffic.

Note: This script has been rewritten now includes a configuration file refer to supplementary section (5.2-Nano and 5.3-Nano) for details.

DtDNS account

Creating an account at DtDNS is extremely easy.

  • Go to DtDNS home page.
  • To the right of log in click Create an Account

There are two pages to fill in, enter the following details:

&nbsp; Page 1: &nbsp;
1) Desired Username This name is used for logging into your account
2) Your Name Your real name (Internal use)
3) Desired Password A password for logging into your account
4) Confirm Password As above
5) E-mail Address A real active e-mail is required, activation code sent to this e-mail address
6) Confirm E-mail As above
7) Optional Skip the Optional Information section if you wish fill it in.
8) Two CAPCHA words Enter the two CAPCHA words (if these are difficult to read click the new challenge button)
&nbsp; Page 2: &nbsp;
9) Username Enter your Username as entered in 1).
10) Enter code Enter code sent to your email. (Note: The email contains a link to page 2 hence you can close the page and wait for the e-mail.)

Top

Login - Create Hostname

General information:

  • A DtDNS account is limited to five free hostnames.
  • A hostname is concatenated with a domain name.
  • I have listed available domains on the right.<br /><br />
  • Your full URL for example
    • If you chose books as hostname
    • And select from the drop down menu effers.com

Will look like this:

<nowiki>http://</nowiki>books.effers.com

&nbsp;&nbsp;

Available Free Domain Names

<pre> 3d-game.com 4irc.com b0ne.com bbsindex.com chatnook.com darktech.org deaftone.com dtdns.net effers.com </pre>

<pre> etowns.net etowns.org flnet.org gotgeeks.com scieron.com slyip.com slyip.net suroot.com

</pre>

Wild Cards:

After creating a hostname wild cards are enabled by default. This allows you to use a URL such as

<nowiki>http://</nowiki>www.books.effers.com - Note www. is the wild card part this can be anything you like for example:

  • <nowiki>http://</nowiki>www.books.effers.com
  • <nowiki>http://</nowiki>www-internation.books.effers.com
  • <nowiki>http://</nowiki>local.books.effers.com
  • <nowiki>http://</nowiki>www.home.books.effers.com

books.effers.com resolves to your IP address you can use the wild card on your server to resolve to different sites.

Top

Create Hostname

To create a new hostname at DtDNS

Login

  • Go to | Login page
  • Enter Username: as set in step 1)
  • Enter Password: as set in step 3)
  • My Services page displayed
  • Click on Hostnames this opens the Hostname Manager

Create hostname

  • Enter a desired Hostname
  • From the drop down menu select a Domain
  • Click Add Hostname
  • Enter the two CAPCHA words (if these are difficult to read click the new challenge button)
  • Click Add Hostname button
  • This is added to your list of host names

Manage existing hostnames

To manage existing hostnames, simply click the entry in the list for example see below.

Hostname Domain IP Address Type
uni23 dtdns.net 89.119.35.45 Active Dynamic
books effers.com 87.129.30.174 Active Dynamic

Click a hostname link opens its corresponding configuration page. Here you can change various settings, including the IP address.

Note: After adding a new host the IP address is set to your current IP address. You can manually change it on the configuration page or request an IP update see later.

Top

Script Configuration

You need to configure the script, which can be found in folder:

UniServer\plugins\dtdns_updater\dtdns_updater.php

In the user configuration section locate these lines:

  • $id_pw[] = "books.effers.com,fred123"; // Change
  • $id_pw[] = "books.effers.com,fred123"; // Change or delete
  • $id_pw[] = "books.effers.com,fred123"; // Change or delete

Substitute books.effers.com with your real host and domain names, replace the password fred123 with the one you set in step 1)

If you have only a single host delete the other two lines. Otherwise modify them for each additional host as above. Add additional lines as required.

<pre> <?php /*

  1. Name: The Uniform Server DtDNS Updater v 1.0
  2. Developed By: The Uniform Server Development Team
  3. Modified Last By: Mike Gleaves (Ric)
  4. Web: http://www.uniformserver.com
  • /

//error_reporting(0); // Disable PHP errors and warnings

                     // Comment to Enable for testing

chdir(dirname(__FILE__)); // Change wd to this files location include_once "../../unicon/main/includes/config.inc.php"; include_once "../../unicon/main/includes/functions.php";

run_location_tracker(); // Have servers moved if moved update configuration print"\n";

//######################## User Configuration ################################# // Add as many lines as required with the following format: // $id_pw[] = "hostname,password"; // For example: // $id_pw[] = "books.effers.com,fred123"; // $id_pw[] = "power.dtdns.net,gun22powder"; //-----------------------------------------------------------------------------

$id_pw[] = "books.effers.com,fred123"; // Change $id_pw[] = "books.effers.com,fred123"; // Change or delete $id_pw[] = "books.effers.com,fred123"; // Change or delete

//###################### END User Configuration ###############################

$test = false; // Test true = display IP address and host names

             // false = no display

foreach ($id_pw as $value) { // Iteratate through array

 $idpw_array = explode(",",$value);                // Split id pw pairs
 if(get_ip_dns($idpw_array[0])){                   // Was IP from DNS returned
   if(get_ip_current()){                           // Yes: Current IP returned
     if($test){ // Test code
      print "DNS IP = $ip_dns CURRENT IP = $ip_current $idpw_array[0]<br/>\n";
     }
     if($ip_dns != $ip_current){                   // Are IP's different
       dtdns_update($idpw_array[0],$idpw_array[1]);// yes: Update required
     }
   }
 }

}// End foreach

//=== Get IP from DNS server ================================================== // Input: ID = Hostname: // Output: Return value true = IP was obtained // Output: Return value false = IP not obtained or error // Output: $ip_dns either IP address or host name

function get_ip_dns($hostname){

 global $ip_dns;                      // IP address saved from DNS server
 $ip_dns = gethostbyname($hostname);  // Get IP address of hostname
 if($ip_dns == $hostname){            // Is hostname returned (not IP address) 
   return false;                      // yes: failed to get IP address
 }
 else{                                // no: IP obtained  
   return true;                       // set success 
 }

} //============================================== END Get IP from DNS server ===

//=== DtDNS Host Update Page ================================================== // Input: $id = Hostname: // Input: $pw = User password // Output: Return value true = sucess false = failed

function dtdns_update($id,$pw){ $id_val = urlencode($id); // User Host on DtDNS $pw_val = urlencode($pw); // User password $client_val = urlencode('UniServerV1'); // Optional - But added it $url = 'https://www.dtdns.com/api/autodns.cfm'; // DtDNS update page

// Build complete URL $str= $url."?id=".$id_val."&pw=".$pw_val."&client=".$client_val;

// Access page using Curl SSL $ch=curl_init(); // Initialize Curl get handle curl_setopt($ch,CURLOPT_URL,$str); // Set Curl URL option curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // no verify curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,10); // timeout set to 10 sceonds curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); // curl_exec ouputs a string $buffer = curl_exec($ch); // run above, save to buffer curl_close($ch); // Close Curl frees memory

// Test returned page if(preg_match("/now\spoints\sto/",$buffer)){// Is returne value "now points to"

return true;                               // yes: update OK

} else{ // no: Failed

return false;

} } //============================================== END DtDNS Host Update Page === ?> </pre>

Top

Manual Update

You can run the following batch file to manually force an update, remember to leave around ten minuets before performing another manual update.

It takes around ten minutes for the DNS to propagate, additional updates within this period are regarded as an abuse and you may find your IP banned.

Batch file: UniServer\plugins\dtdns_updater\Run_dtdns_updater.bat

Contains: <pre> COLOR B0 @echo off cls

rem ### working directory current folder pushd %~dp0

..\..\usr\local\php\php.exe dtdns_updater.php

rem ### restore original working directory pause popd EXIT </pre> Top

Cron - Automatic update

Cron provides a periodic tick Uniform Server's default is every ten minutes.

DtDNS automatic updater has been pre-configured however it is disabled by default.

To enable Cron edit file UniServer\unicon\main\run_cron.php

Locate these two line in section List of scripts to be run <pre>

 // $cmd = 'start ..\..\usr\local\php\php-win.exe ..\..\plugins\dtdns_updater\dtdns_updater.php';
 // pclose(popen($cmd,'r'));             // Start detatched process  

</pre> and uncomment as shown below <pre>

 $cmd = 'start ..\..\usr\local\php\php-win.exe ..\..\plugins\dtdns_updater\dtdns_updater.php';
 pclose(popen($cmd,'r'));             // Start detatched process  

</pre> Notes:

  • When the server is first started Cron is run and the IP addreess updated if different
  • Every ten minuets Cron is run and the IP address are checked if different are updated.
  • Cron only runs when the servers are running however you can force an update using the batch file mentioned above.
  • Cron can be manually or automatically started see next page for details.

Top

Summary

For a home web server the free account at DtDNS is ideal at least it gives you an opportunity to test their service. Perhaps it will encourage you to purchase a real domain and use some of their paid services.

The next page looks at Cron in more detail.

Top