|
DynDNS - My own Internet domain
By Uwe Holz
Last Update:
Thursday, November 03, 2005
More info about dynamic DNS can be found at http://www.dyndns.org.
Do you want to host your own web site by yourself using your DSL connection to the Internet? You don't want to depend on an external ISP anymore? Do you want to have this all for free? Here is how it works.
How to get my own Domain for free ?
One of the best places to obtain your own domain name for free is DynDNS (www.dyndns.org). Beside other offers you will find there a free of charge service which redirects all requests for your registered domain name to the dynamic Internet IP, the external IP address of your DSL router (delivered by your ISP for your current Internet session).
The IP redirection enables you to host your home page at your computer instead of using a third party ISP. The DSL connection acts like an otherwise pretty expensive permanent connection line.
The client Program
In order to keep track about IP changes and their updates at DynDNS.org you need to install a client tool watching the external IP address of your DSL router. Therefore I wrote a program running on Linux and Windows (NT/Win2K/XP). It does following steps in detail:
- Determining current IP address by pre defined time intervals
(e.g. 5 minutes)
- Updating current IP address at DynDNS.org
if it has been changed since last check
- Storing current IP for the next check
You will find both versions (including C++ source code) as part of following archive file: dyndns-10.zip
How do I receive my current IP?
Determining the current IP your are connected to the Internet with is pretty simple. Take a look to the following source code in order to see why:
int main(int argc, char** argv)
{
char * psz = getenv("REQUEST_METHOD");
if ( psz && strlen(psz) )
{
printf("Content-Type: text/html\r\n\r\n");
printf("<html><head><title>\r\n");
printf("Current IP Check</title></head><body>\r\n");
printf("Current IP Address: ");
printf(getenv("REMOTE_ADDR"));
printf("\r\n<br /></br />");
printf("<a href='javascript:history.go(-1)'>Back</a>");
printf("\r\n</body></html>");
}
else
{
printf("Error: CGI environment required");
}
return 0;
}
The appropriate binary can be tested by clicking the following link .
Steps to obtain and set up your own Internet domain
- Create an account at DynDNS.org (only e-mail, user name and password are required)
-
-
Install dyndns Client
Client installation (Windows)
-
Copy dyndns.exe and dyndns.ini into a separate directory
-
Adjust dyndns.ini entries (especially user:password und xyz.serveftp.net in order to meet the values registered at DynDNS.org)
Test
-
dyndns behavior from the command line (DEBUG=2): c:\>cd dyndns
c:\dyndns>dyndns.exe -exec
-
Install dyndns.exe as a Service c:\>cd dyndns
c:\dyndns>dyndns.exe -install
-
Configure time intervals for IP checks via dyndns.ini (section SERVICE, value TIMEOUT)
-
Configure
the Windows Startup Behavior of your service by Service Manager
(Control Panel/Administrative Tools/Services)

Client installation (Linux)
-
Copy dyndns and dyndns.ini into a separate directory, e.g. /usr/local/dyndns:
-
Change the tools right in order to make it executable: lx:/home/admin # cd /usr/local/dyndns
lx:/usr/local/dyndns # chmod 755 dyndns
-
Adjust dyndns.ini entries (especially user:password und xyz.serveftp.net in order to meet the values registered at DynDNS.org)
-
Test dyndns behavior from the command line (DEBUG=2): lx:/home/admin # cd /usr/local/dyndns
lx:/usr/local/dyndns # ./dyndns
- Create a crontab (/etc/crontab) entry for dyndns in order to start the utility every 5 minutes:
*/5 * * * * root /usr/local/dyndns/dyndns
|