
Dynamic DNS Agent for NO-IP, v1.0
-------------------------------------------
Author:  Patrick J. Gleason
Date:  31-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.no-ip.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 NO-IP assigns this IP
address to the DNS record that you specify in the "NO-IP.INI" file.
This program spends most of its time "sleeping", but wakes up at
periodic intervals to access the NO-IP web site, which sets the IP
address for the DNS record(s) you specified.  Your master DNS records are
hosted by no-ip.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
NO-IP 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 "NO-IP.INI" is used to tell this program
how to log on to "dynupdate.no-ip.com", which DNS record(s) to update, and
how often to check for changes.  This configuration file defines eight
parameters, some of which are optional.  Blank lines and lines beginning
with a semicolon in the configuration 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
        --------------------------------------------------------
        username:       The "username" parameter specifies the
                        user name that you would use to log on
                        at "http://www.no-ip.com" to manually
                        update your DNS record(s).  No-IP uses
                        an e-mail address as the usernmae.
                        E-mail addresses can be no longer than
                        50 characters.  THIS PARAMETER IS
                        REQUIRED.

        password:       The "password" parameter specifies the
                        password associated with "username" that
                        you would use to log on to No-IP.

        hostname:       The "hostname" parameter specifies the DNS
                        record(s) that you want to update.  Multiple
                        records can be updated to the same IP address
                        by using a comma separated list.  A single
                        host might be specified as "host.domain.net",
                        or multiple hosts can be specified as
                        "host1.domain.net,host2.domain.net,..."
                        This parameter is optional if the "group"
                        parameter is used.  If the "group" parameter
                        is not used, then this parameter is required.

        group:          The "group" parameter specifies a group of DNS
                        records to be updated.  Multiple groups may be
                        specified by a comma separated list.  This
                        parameter is optional and may be left blank,
                        commented out or omitted.

        ip:             The "ip" parameter specifies the IP address to
                        which the host(s) or group(s) will be set.
                        This parameter is optional.  If it is left
                        blank, commented out or omitted, then the
                        WAN address connecting to the No-IP server is
                        used.  Clients behind NAT, for example, would
                        not need to supply an IP address.

        offline:        The "offline" parameter may be set to "YES" or
                        "NO".  Offline settings are an Enhanced/No-IP
                        Plus feature.  When offline mode is enabled,
                        the host will use whatever offline method is
                        selected on the No-IP.com web site for that
                        host.  This parameter is not supported for
                        update groups.  If submitting "offline: YES"
                        and a group name at the same time, then the
                        system will treat it as a normal update and
                        not put hosts in that group into offline
                        mode.  If an update request is performed on
                        an offline host, then the host is removed from
                        the offline state.  This parameter is optional.
                        If it is left blank, commented out or omitted,
                        then the default is "NO".

        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 just do one IP
                        address check and update, then exit, perhaps
                        as part of a "CHRON" batch job, then specify
                        0 for the period.

        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:

        NO-IP

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.

