Below is a list of the software packages and versions this was completed on. These instructions will most likely work for other versions and software packages with minor (if any) modifications.
This page is being re-wrote. Below are my old notes
This howto is half wrote! Don't follow it! IT might not even make sense. IT's apt to cause your computer to blow up, your girl/boy friend to get pregnant and might even get you confused. Maybe in a few days I'll have it wrote enough to make sense - but that's not right now.
Ever wanted to be able to access your home computer/network from anywhere? Without having to guess what your dynamic IP address might be at the time? How about if you could connect to it with a public domain name such as.. http://home.mydomain.com… But how do you assign a public domain name to the dynamic ip address that your internet provider assigns you? Well… with Dynamic DNS! It allows you to assign a real fully qualified domain name to your dynamic IP address. Nifty! There's a lot of companies that provide this service. Some charge a fee, some are free. You're encouraged to research them and see if they fit your needs. A quick google search http://www.google.com/search?q=Dynamic+DNS will give you a handful of providers.
Sure can! And that's exactly what this HowTo will tell you how to do!
To use the method below you -must- have your own PHP webserver with the command line tools nsupdate, openssl, and awk. You also must either be in control of the bind (dns) server for whichever domain you want to use -or- at least be able to update the dns server via nsupdate. If you don't meet these requirements feel free to read the howto. Perhaps you can adjust it to match your environment.
Just so you know the environment I build this in and how I'm using it.
I have a Linux web/dns server for my domain sqls.net (big surprise!). It's located on a public -static- IP address (big surprise again!). So in this case I am in full control of the bind configuration for my dns records and am able to host the required php scripts. Next, I have some basic internet at my condo though cox cable and of course they are assigning me a dynamic IP address. I am also using a Buffalo router with DD-WRT loaded on it at my condo.
Okay, a quick summary. You need to configure the dns server to allow updates to your domain. Then you need to install the PHP script on your webserver. Finally you must choose and configure the client machine that will update (via the PHP script) the DNS records.
This section covers bind 9.4 on a Linux server that you are in control of. If this isn't your setup then.. improvise. If your DNS is managed by someone else you might call them and see if it's possible to update the DNS records with nsupdate.
Inside your named.conf file find the entry for your domain. It should look something like this
zone “mydomain.com” IN {
type master; file "pri/mydomainfile.db";
};
Add the line below to your entry but change domain.com to your actual domain name.
update-policy { grant *.mydomain.com. self mydomain.com. A; };
So the final entry looks like
zone “mydomain.com” IN {
type master;
file "pri/mydomainfile.db";
update-policy { grant *.mydomain.com. self mydomain.com. A; };
};
Create a super secret password! To do this, pick a work/phrase/whatever you want to use. Then run the following shell command
echo supersecret | openssl md5 | openssl base64
Now copy the output, you'll need it here in a minute. Oh, write down the supersecret you decided to use. You'll need that later too.
Open named.conf back up, and just below your domain entry (the one you just modified) Add the below entry. Again, change mydomain.com to your actual domain. Change the data for the secret field to the output you got from our previous command.
key home.mydomain.com. {
algorithm hmac-md5; secret "Zjc1NTM4OWZkNzk4NjI0OTNmYTJmNzFjNTUzNjgwMDYK";
};
Okay, we're all done with named.conf and your bind server will allow the host home.mydomain.com to update it's DNS record provided it happens to know it's supersecret password.
My script is just one simple php file! Copy -this- file to your webserver. Put it where ever you want. You can rename it or place it in it's own subdirectory. It doesn't matter. But just remember where you put because we'll need to connect to it via the web later on. Actually! Once you copy it over! Go ahead and open it up in web browser. You should get a very simple form that you can use for testing. Enter your hostname and supersecret password in the appropriate boxes and it'll attempt to update your dns records.
Pretty much you do the same for any client. You, somehow. Get it to access the php script and provide to it the hostname and supersecret password. You could make this a bookmark in firefox/iexplorer that you just fire up once a day at home. You can add it to a scheduled task in windows. You could make it a cron process on linux. You can do evil evil things to your router, such as.. Installing DD-WRT and have it (via a cron job) do the work. So if your client isn't listed. Be creative.
This is for my DD-WRT v23 SP2. It's what I did. Your version might be different and may require additional thought.
Open DD-WRT Admin interface. Click on Administration, Then Click on Commands. Enter the below test in the big text box then click Save Startup. Oh, and uh. You should, once again, change mydomain.com to your actual domain name. Also, change supersecret to whatever supersecret password you used a while back when generating the TSIG key with openssl. If you put the ddns.php file anywhere besides the base/root folder of your website or changed its name. Then please make appropriate changes to the line below to reflect it.
/bin/sh -c 'echo “*/10 * * * * root /usr/bin/wget http://mydomain.com/ddns.php?fqdn=home.mydomain.com\&key=supersecret -O - >/dev/null 2>&1” > /tmp/cron.d/ddns'
Once saved. This should connect to the php script every 10 mins. You can adjust it to run less frequently or more frequently. If your not sure how, research crontab.