https://wiki.uniformserver.com/index.php?title=5.0-Nano:_DtDNS&feed=atom&action=history5.0-Nano: DtDNS - Revision history2024-03-29T11:25:52ZRevision history for this page on the wikiMediaWiki 1.41.0https://wiki.uniformserver.com/index.php?title=5.0-Nano:_DtDNS&diff=4930&oldid=prevOlajideolaolorun: Reverted edits by Upazixorys (Talk); changed back to last version by Ric2010-11-24T17:37:56Z<p>Reverted edits by <a href="/Special:Contributions/Upazixorys" title="Special:Contributions/Upazixorys">Upazixorys</a> (<a href="/index.php?title=User_talk:Upazixorys&action=edit&redlink=1" class="new" title="User talk:Upazixorys (page does not exist)">Talk</a>); changed back to last version by <a href="/User:Ric" title="User:Ric">Ric</a></p>
<a href="https://wiki.uniformserver.com/index.php?title=5.0-Nano:_DtDNS&diff=4930&oldid=4870">Show changes</a>Olajideolaolorunhttps://wiki.uniformserver.com/index.php?title=5.0-Nano:_DtDNS&diff=4870&oldid=prevUpazixorys at 10:22, 24 November 20102010-11-24T10:22:16Z<p></p>
<a href="https://wiki.uniformserver.com/index.php?title=5.0-Nano:_DtDNS&diff=4870&oldid=3914">Show changes</a>Upazixoryshttps://wiki.uniformserver.com/index.php?title=5.0-Nano:_DtDNS&diff=3914&oldid=prevRic at 17:16, 9 October 20092009-10-09T17:16:57Z<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 17:16, 9 October 2009</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l9">Line 9:</td>
<td colspan="2" class="diff-lineno">Line 9:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''''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.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''''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.</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">'''''Note'':''' This script has been rewritten now includes a configuration file refer to [[5.3-Nano: DtDNS | '''supplementary section''']] (5.2-Nano and 5.3-Nano) for details.</ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== DtDNS account ==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== DtDNS account ==</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Creating an account at DtDNS is extremely easy.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Creating an account at DtDNS is extremely easy.</div></td></tr>
</table>Richttps://wiki.uniformserver.com/index.php?title=5.0-Nano:_DtDNS&diff=3862&oldid=prevRic: New page: {{Nav 5.0-Nano}} '''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...2009-09-11T19:34:09Z<p>New page: {{Nav 5.0-Nano}} '''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...</p>
<p><b>New page</b></p><div>{{Nav 5.0-Nano}}<br />
'''Uniform Server and DtDNS'''<br />
<br />
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.<br />
<br />
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.<br />
<br />
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.<br />
<br />
'''''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.<br />
== DtDNS account ==<br />
Creating an account at DtDNS is extremely easy.<br />
<br />
* Go to DtDNS [http://www.dtdns.com/ '''home'''] page.<br />
* To the right of '''log in''' click '''Create an Account'''<br />
<br />
There are two pages to fill in, enter the following details:<br />
{|<br />
|&nbsp;||'''''Page 1'':'''||&nbsp;<br />
|-<br />
|1)||'''Desired Username'''||This name is used for logging into your '''account'''<br />
|-<br />
|2)||'''Your Name'''||Your real name (Internal use)<br />
|-<br />
|3)||'''Desired Password'''||A password for logging into your '''account'''<br />
|-<br />
|4)||'''Confirm Password'''||As above<br />
|-<br />
|5)||'''E-mail Address'''||A real active e-mail is required, activation code sent to this e-mail address<br />
|-<br />
|6)||'''Confirm E-mail'''||As above<br />
|-<br />
|7)||'''Optional'''||Skip the Optional Information section if you wish fill it in.<br />
|-<br />
|8)||'''Two CAPCHA words'''||Enter the two CAPCHA words (if these are difficult to read click the new challenge button) <br />
|-<br />
|&nbsp;||'''''Page 2'':'''||&nbsp;<br />
|-<br />
|9)||'''Username'''||Enter your Username as entered in '''1)'''.<br />
|-<br />
|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.)<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Login - Create Hostname ==<br />
'''''General information'':'''<br />
{|<br />
|-valign="top"<br />
|<br />
*A DtDNS account is limited to '''five free''' hostnames.<br />
* A hostname is concatenated with a '''domain''' name.<br />
* I have listed available domains on the right.<br /><br /><br />
* Your full URL for example<br />
** If you chose '''books''' as hostname<br />
** And select from the drop down menu '''effers.com'''<br />
<br />
Will look like this:<br />
<br />
'''<nowiki>http://</nowiki>books.effers.com''' <br />
|<br />
&nbsp;&nbsp;<br />
|<br />
{|<br />
|-<br />
|'''''Available Free Domain Names'''''<br />
|-<br />
|<br />
<pre><br />
3d-game.com<br />
4irc.com<br />
b0ne.com<br />
bbsindex.com<br />
chatnook.com<br />
darktech.org<br />
deaftone.com<br />
dtdns.net<br />
effers.com<br />
</pre><br />
|<br />
<pre><br />
etowns.net<br />
etowns.org<br />
flnet.org<br />
gotgeeks.com<br />
scieron.com<br />
slyip.com<br />
slyip.net<br />
suroot.com<br />
<br />
</pre><br />
|}<br />
|}<br />
'''''Wild Cards'':'''<br />
<br />
After creating a hostname wild cards are enabled by default. This allows you to use a URL such as <br />
<br />
<nowiki>http://</nowiki>'''www.'''books.effers.com - Note '''www.''' is the wild card part this can be anything you like for example:<br />
<br />
* <nowiki>http://</nowiki>www.'''books.effers.com'''<br />
* <nowiki>http://</nowiki>www-internation.'''books.effers.com'''<br />
* <nowiki>http://</nowiki>local.'''books.effers.com'''<br />
* <nowiki>http://</nowiki>www.home.'''books.effers.com'''<br />
<br />
'''books.effers.com''' resolves to your IP address you can use the wild card on your server to resolve to different sites.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Create Hostname ===<br />
To create a new hostname at DtDNS<br />
<br />
'''''Login'''''<br />
* Go to [https://www.dtdns.com/index.cfm?fuseaction=account.login | Login page]<br />
* Enter Username: as set in step '''1)''' <br />
* Enter Password: as set in step '''3)''' <br />
* '''My Services''' page displayed<br />
* Click on '''Hostnames''' this opens the '''Hostname Manager'''<br />
'''''Create hostname'''''<br />
* Enter a desired '''Hostname'''<br />
* From the drop down menu select a Domain <br />
* Click '''Add Hostname'''<br />
* Enter the '''two CAPCHA''' words (if these are difficult to read click the new challenge button) <br />
* Click '''Add Hostname''' button<br />
* This is added to your list of host names<br />
<br />
=== Manage existing hostnames ===<br />
To manage existing hostnames, simply click the entry in the list for example see below.<br />
<br />
{|cellspacing="6"<br />
|-<br />
|'''Hostname'''||'''Domain'''||'''IP Address'''||'''Type'''<br />
|-<br />
|uni23||dtdns.net||89.119.35.45||Active Dynamic<br />
|-<br />
|books||effers.com||87.129.30.174||Active Dynamic<br />
|}<br />
Click a hostname link opens its corresponding configuration page. Here you can change various settings, including the IP address.<br />
<br />
'''''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.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Script Configuration ==<br />
You need to configure the script, which can be found in folder:<br />
<br />
UniServer\plugins\dtdns_updater\'''dtdns_updater.php'''<br />
<br />
In the user configuration section locate these lines:<br />
<br />
* $id_pw[] = "'''books.effers.com''','''fred123'''"; // Change<br />
* $id_pw[] = "'''books.effers.com''','''fred123'''"; // Change or delete<br />
* $id_pw[] = "'''books.effers.com''','''fred123'''"; // Change or delete<br />
Substitute '''books.effers.com''' with your real host and domain names, replace the password '''fred123''' with the one you set in step 1)<br />
<br />
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. <br />
<br />
{|<br />
|-<br />
|<br />
<pre><br />
<?php<br />
/*<br />
###############################################################################<br />
# Name: The Uniform Server DtDNS Updater v 1.0<br />
# Developed By: The Uniform Server Development Team<br />
# Modified Last By: Mike Gleaves (Ric) <br />
# Web: http://www.uniformserver.com<br />
###############################################################################<br />
*/<br />
//error_reporting(0); // Disable PHP errors and warnings<br />
// Comment to Enable for testing<br />
<br />
chdir(dirname(__FILE__)); // Change wd to this files location<br />
include_once "../../unicon/main/includes/config.inc.php";<br />
include_once "../../unicon/main/includes/functions.php";<br />
<br />
run_location_tracker(); // Have servers moved if moved update configuration<br />
print"\n";<br />
<br />
//######################## User Configuration #################################<br />
// Add as many lines as required with the following format:<br />
// $id_pw[] = "hostname,password";<br />
// For example:<br />
// $id_pw[] = "books.effers.com,fred123";<br />
// $id_pw[] = "power.dtdns.net,gun22powder";<br />
//-----------------------------------------------------------------------------<br />
<br />
$id_pw[] = "books.effers.com,fred123"; // Change<br />
$id_pw[] = "books.effers.com,fred123"; // Change or delete<br />
$id_pw[] = "books.effers.com,fred123"; // Change or delete<br />
<br />
//###################### END User Configuration ###############################<br />
<br />
$test = false; // Test true = display IP address and host names<br />
// false = no display<br />
<br />
foreach ($id_pw as $value) { // Iteratate through array<br />
$idpw_array = explode(",",$value); // Split id pw pairs<br />
<br />
if(get_ip_dns($idpw_array[0])){ // Was IP from DNS returned<br />
if(get_ip_current()){ // Yes: Current IP returned<br />
<br />
if($test){ // Test code<br />
print "DNS IP = $ip_dns CURRENT IP = $ip_current $idpw_array[0]<br/>\n";<br />
}<br />
<br />
if($ip_dns != $ip_current){ // Are IP's different<br />
dtdns_update($idpw_array[0],$idpw_array[1]);// yes: Update required<br />
}<br />
}<br />
}<br />
}// End foreach<br />
<br />
//=== Get IP from DNS server ==================================================<br />
// Input: ID = Hostname:<br />
// Output: Return value true = IP was obtained<br />
// Output: Return value false = IP not obtained or error<br />
// Output: $ip_dns either IP address or host name<br />
<br />
function get_ip_dns($hostname){<br />
global $ip_dns; // IP address saved from DNS server<br />
$ip_dns = gethostbyname($hostname); // Get IP address of hostname<br />
if($ip_dns == $hostname){ // Is hostname returned (not IP address) <br />
return false; // yes: failed to get IP address<br />
}<br />
else{ // no: IP obtained <br />
return true; // set success <br />
}<br />
}<br />
//============================================== END Get IP from DNS server ===<br />
<br />
//=== DtDNS Host Update Page ==================================================<br />
// Input: $id = Hostname:<br />
// Input: $pw = User password<br />
// Output: Return value true = sucess false = failed<br />
<br />
function dtdns_update($id,$pw){<br />
$id_val = urlencode($id); // User Host on DtDNS<br />
$pw_val = urlencode($pw); // User password<br />
$client_val = urlencode('UniServerV1'); // Optional - But added it<br />
$url = 'https://www.dtdns.com/api/autodns.cfm'; // DtDNS update page<br />
<br />
// Build complete URL<br />
$str= $url."?id=".$id_val."&pw=".$pw_val."&client=".$client_val;<br />
<br />
// Access page using Curl SSL<br />
$ch=curl_init(); // Initialize Curl get handle<br />
curl_setopt($ch,CURLOPT_URL,$str); // Set Curl URL option <br />
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // no verify<br />
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,10); // timeout set to 10 sceonds<br />
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); // curl_exec ouputs a string <br />
$buffer = curl_exec($ch); // run above, save to buffer<br />
curl_close($ch); // Close Curl frees memory<br />
<br />
// Test returned page <br />
if(preg_match("/now\spoints\sto/",$buffer)){// Is returne value "now points to"<br />
return true; // yes: update OK<br />
}<br />
else{ // no: Failed<br />
return false;<br />
}<br />
}<br />
//============================================== END DtDNS Host Update Page ===<br />
?><br />
</pre><br />
|}<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Manual Update ===<br />
You can run the following batch file to manually force an update, remember to leave around ten minuets before performing another manual update.<br />
<br />
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. <br />
<br />
Batch file: UniServer\plugins\dtdns_updater\'''Run_dtdns_updater.bat'''<br />
<br />
Contains:<br />
<pre><br />
COLOR B0<br />
@echo off<br />
cls<br />
<br />
rem ### working directory current folder <br />
pushd %~dp0<br />
<br />
..\..\usr\local\php\php.exe dtdns_updater.php<br />
<br />
rem ### restore original working directory<br />
pause<br />
popd<br />
EXIT<br />
</pre><br />
'''''[[#top | Top]]'''''<br />
=== Cron - Automatic update ===<br />
Cron provides a periodic tick Uniform Server's default is every ten minutes.<br />
<br />
DtDNS automatic updater has been pre-configured however it is disabled by default.<br />
<br />
To enable Cron edit file UniServer\unicon\main\'''run_cron.php''' <br />
<br />
Locate these two line in section '''List of scripts to be run'''<br />
<pre><br />
// $cmd = 'start ..\..\usr\local\php\php-win.exe ..\..\plugins\dtdns_updater\dtdns_updater.php';<br />
// pclose(popen($cmd,'r')); // Start detatched process <br />
</pre><br />
and uncomment as shown below<br />
<pre><br />
$cmd = 'start ..\..\usr\local\php\php-win.exe ..\..\plugins\dtdns_updater\dtdns_updater.php';<br />
pclose(popen($cmd,'r')); // Start detatched process <br />
</pre><br />
'''''Notes'':'''<br />
* When the server is first started Cron is run and the IP addreess updated if different<br />
* Every ten minuets Cron is run and the IP address are checked if different are updated.<br />
* Cron only runs when the servers are running however you can force an update using the batch file mentioned above.<br />
* Cron can be manually or automatically started see [[5.0-Nano: Portable Cron | '''next page''']] for details.<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
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.<br />
<br />
The next page looks at [[5.0-Nano: Portable Cron | '''Cron''']] in more detail.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Uniform Server 5.0-Nano]]<br />
[[Category: Installation]]</div>Ric