Reference Manual

HOW TO use the 2MYDNS dynamic DNS service.

The 2MYDNS Service is one of several Dynamic DNS services available on the Internet.

Updating your 2MYDNS entry is done as follows:

You point your Web browser to a special URL containing your account details and your new IP address. The targeted Web Server then updates your details using the information supplied in the URL and then returns a page which holds just a simple status message.

NAT32 has a special command called url which can submit any desired URL to Internet Explorer and then print the downloaded page as text.

This How-To explains how to automate this procedure using two small script files.

Step 1

Download the 2mydns script file and save it in your NAT32 directory. Run the script whenever you need to do an update.

The script first executes the NAT32 ip command to ensure that the internal NAT32 IP address variables are up to date. Then it executes a for command which runs a TCL script called ddns described below.

for pip ddns $var

The for command executes the ddns script after substituting the value of the pip variable (which holds the current IP address of your Internet connection) for the $var placeholder.

Step 2

Download the ddns TCL script file and save it in your NAT32 directory. Edit it to meet your needs as described below.

The script can be executed directly if you want, just type:

ddns x.x.x.x

and it will generate and execute an appropriate url command to set your new IP address to x.x.x.x.

The ddns script works like this:

  1. It first checks that it really was invoked with an argument holding the IP address you want to set.
  2. It then sets a TCL variable called url to hold a specially formatted URL as specifed here under the "Technical Specifications" link on that page.
  3. The script then executes a NAT32 url command with the TCL $url variable as an argument. This makes Internet Explorer load the URL and it is this which causes the update to take place. Note that by accessing a web page, you can make things happen on the server that the URL points to. That's why the URL has the complicated syntax.
  4. You must edit the set url line in the ddns script file so that it contains your usercode and password, your 2mydns name, and anything else you might need. The \" at the start and at the end of the actual URL is critical, it won't work without them. The actual IP address is substituted in the $url variable so that it is equal to the value you passed in when the ddns script was invoked. If it was invoked from within the 2mydns script, then that script will have figured out the address for you.
  5. Once the URL has been sent, the exec command will print whatever response the server returns. It will either be an error message or a success message.
  6. To further automate the procedure, you could add the 2mydns command to your connect file, as that file is executed whenever a Dial-Up Networking connection is established. Similarly, adding the command to your change file will execute the script whenever a DHCP-assigned address changes.
[How-To Index][HOME]