
Dynamic DNS Agent for www.easydns.com, v1.0
-------------------------------------------
Author:  Patrick J. Gleason
Date:  7-Jan-2007
Project:  Bulletron Internet Operating System 12.0
Operating System:  OS/2 Warp 4.0 and later, eComStation
Compiler:  IBM VisualAge C++ 3.0
Phone: (315) 475-5598
Email: ora68@nehemiah.idkcomp.com
Web Site: http://www.idkcomp.com

This program lets you host a web server (or FTP, SMTP, etc.) without
having a static IP address; i.e., the IP address of your server is
established via DHCP.  Your server can be behind a firewall router
performing NAT (network address translation).  This program is
explicitly written to use the dynamic DNS service at
"http://www.easydns.com".  You are welcome to write or phone me if you
want a similar program for some other dynamic DNS service.


How it Works:
--------------
Let's say you sign up with a service like Road Runner, and have a cable
modem that provides you with exactly one IP address.  To this, you
connect an inexpensive firewall router, like a Linksys BEFSR41.  The
firewall router lets you connecct a bunch of PCs to the Internet by
providing local IP addresses of the form "192.168.1.x".  The firewall
router lets all of the PCs on your LAN (local network) communicate with
each other by assigning them IP addresses like "192.168.1.101",
"192.168.1.102", etc.  It also routes any traffic not for your LAN to
the cable modem, which has an IP address that is unique to the entire
world.

For this example, suppose that the cable modem has the IP address,
"69.202.128.79", which is unique to the entire world, but could change
at any minute at the whim of the ISP.  On your LAN, you use a web
browser with an IP address of "192.168.1.103" (assigned by your router)
to access a web server outside the LAN.  Your firewall router translates
your PC's internet address to "69.202.128.79", port 80.  The remote web
server sends packets back to your PC using an IP address like
"69.202.128.79" port 1053.  Your firewall router translates
"69.202.128.79" port 1053 to "192.168.1.103" port 1053 and you are
surfing the web.  Your firewall router maintains an internal table that
it uses to route packets coming back from remote server(s) to the right
PCs inside your LAN, based on the port numbers.

Now, suppose you want to run a web server on your LAN that the whole
world can see.  On your LAN, your firewall router has assigned the IP
address "192.168.1.95" to the PC hosting your web site.  Using manual
setup for your firewall router, you tell it that any incoming connection
requests for port 80 should be routed to "192.168.1.95".  You can only
have one web server on your LAN that the outside world can see, but
heck, at least one is better than zero.

Any web server outside your firewall router sees the IP address of your
firewall router as the IP address of all hosts on your LAN.  This IP
address is passed to the server program by the TCP/IP sockets drivers
when the connection is made.  The web server at EasyDNS assigns this IP
address to the DNS record that you specify in the "EASYDNS.INI" file.
This program spends most of its time "sleeping", but wakes up at
periodic intervals to access the EasyDNS web site, which sets the IP
address for the DNS record you specified.  Your master DNS records are
hosted by EasyDNS.com, for which you must pay them a modest annual fee
so they can eat and pay their rent.  The Domain Name Server (DNS) at
EasyDNS will propogate updates to your domain name records to the entire
world in a matter of seconds, so you can rapidly effect changes if the
IP address of your web server ever changes.


Set Up Details:
----------------
A plain ASCII text file, named "EASYDNS.INI" is used to tell this
program how to log on to "members.easydns.com", which DNS record to
update, and how often to check for changes.  This configuration file
defines ten parameters, some of which are optional.  Blank lines and
lines beginning with a semicolon in the configurattion file are ignored
as comments.  Each parameter line consists of a label, followed by a
colon, then a space, then a value.  The parameters are:

        Label           Value
        --------------------------------------------------------
        userid:         specifies the user id that you use to
                        log on to "www.easydns.org", manually
                        update your DNS records, and pay your
                        money.  This parameter is required.

        password:       specifes the password that you use for
                        that user id.  This parameter is
                        required.

        hostname:       specifies the whole host name for the
                        DNS record to be updated.  For example,
                        if we update "www.idkcomp.com", then
                        the host name is "www.idkcomp.com",
                        not just "www".  This parameter is
                        required.

        tld:            specifies your domain name.  For
                        example, if we update "www.idkcomp.com",
                        then the top level domain is "com".
                        This parameter is not required, and in
                        most cases should be omitted.  You would
                        only include it for multi-part top
                        domains, such as ".net.nz" or ".co.za".

        myip:           can be used to specify the IP address
                        for "hostname"."domain", overriding
                        automatic detection by the EasyDNS web
                        server.  If you omit this parameter, or
                        specify "1.1.1.1", then the IP address
                        is detected automatically.  If you
                        specify "0.0.0.0", then EasyDNS points
                        your DNS record to a page that tells
                        people your web server is off line.

        mx:             specifies the name of the preferred mail
                        exchanger for this host.  This mail
                        exchanger is given a preference of 5.

        backmx:         can be "YES" or "NO".  "YES" specifies
                        that "smtp.easydns.com" will be set up
                        as a backup mail spool for your domain
                        with a preference of 100.

        wildcard:       can be "ON" or "OFF".  "ON" means that
                        all host names in your domain map to
                        this one IP address, as when you have
                        different servers for different protocols
                        (HTTP, FTP, SMTP, etc.) on different hosts
                        on one LAN with port based NAT.  "OFF" means
                        that this IP address applies only to the
                        specifed "hostname:". If this parameter is
                        omitted, then the default is "OFF".

        period:         specifies the number of hours between
                        checking for IP address changes.  This
                        program will not let you check automatically
                        more than once an hour.  Most cable and DSL
                        providers tend to leave your IP address
                        unchanged for years.  Dial-up connections
                        are pretty much guaranteed to give you a
                        different IP address every time you connect.
                        If you want to run just one IP address check
                        and update, then quit, perhaps as part of
                        a "chron" batch job, then specify a period
                        of zero.

        verbose:        specifies the amount of information recorded
                        in the progam execution log:

                        0 = log IP checks and updates only

                        1 = also include all HTTP protocol details

                        2 = also include DEBUG style (hexadecimal
                            and ASCII) dump of all data sent and
                            received


Running the Program:
---------------------
You can execute this program from any OS/2 or eCS command line prompt
by entering:

        EASYDNS

There are no command line parameters.

You can call it from "STARTUP.CMD", put an object for it in your System
Startup folder, or whatever.

