|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
Most hosts running internet based services use DNS to make their machines easily accessible by name. If you're running some type of server behind your firewall, you'll probably want to give it a domain name (www.mysite.com) to make it easily accessible. Domain names can also be handy for personal use, like if you need to connect to your machine remotely (with PPTP for example). For we humans, names are just simply easier to remember than numbers.
A dedicated server usually runs DNS with a static IP address. It would be a problem if Google's IP address changed constantly, wouldn't it? Unfortunately for those of us running personal servers on basic broadband connections, we have dynamic IP addresses, which are designed to change every so often. To compensate for this, we can use Dynamic DNS. The principle is simple: an extra service runs on the host machine and monitors the IP Address. When it changes, the Dynamic DNS service automatically takes notice, and updates the DNS record on the DNS server. This keeps downtime to a minimum and eliminates the need for you to constantly be updating your records. Best of all, it's free and easy to set up!
Lots of companies offer free Dynamic DNS hosting. For this tutorial we'll be using the popular DynDNS service. DynDNS offers many DNS services, including a reliable and FREE dynamic DNS service.
|
|
|
Alternative Alert! - DynDNS
DynDNS is only one possibility. Just Google "dynamic dns" for lots more! Best of all, the free dynamic dns client we're covering supports just about any of them
! |
|
|
|
|
|
To start off, you'll need to register an account with any internet based dynamic dns service. If you choose DynDNS, you can sign up here: http://www.dyndns.com/services/dns/dyndns/. Registration should be simple and painless, just sign up with any username and password. Make sure not to use a password you've used for other accounts! More on this later... Once you've created your account, you need to add a host record to your account. You'll have to name your new site, most likely it will be in the form of [mysite].dyndns.org. That should be all the account configuration necessary.
The program we'll be using as our client is called ez-ipupdate. It's a very light dynamic dns client written in c that supports lots of different DNS services. I'll spare you another Alternative Alert, but just know there are a lot of other clients you could choose if you want.
Firewall:~# apt-get install ez-ipupdate
ez-ipupdate comes with lots of example configurations for various dynamic dns services. To view them, list the files in /usr/share/doc/ez-ipupdate/examples/:
Firewall:~# ls -al /usr/share/doc/ez-ipupdate/examples/
The actual examples are stored in /etc/ez-ipupdate. To start, copy one of the example configs there, or just create your own:
Firewall:~# cp /usr/share/doc/ez-ipupdate/examples/example-dyndns.conf /etc/ez-ipupdate/ez-ipupdate.conf
Firewall:~# nano -w /etc/ez-ipupdate/ez-ipupdate.conf
Now we just need to give the program some basic information. Here's the entire config first:
#!/usr/sbin/ez-ipupdate -c
service-type=dyndns
user=MyUserName:MyPassword
host=myhostname.dyndns.org
interface=eth0
max-interval=2073600
run-as-user=ez-ipupd
cache-file=/var/cache/ez-ipupdate/default-cache
daemon
Now lets break it down: The first line is necessary because this file will actually be used as an executable. service-type=dyndns defines the type of service we're working with, in my case dyndns (see other files in the examples directory for more). user=MyUserName:MyPassword tells ez-ipupdate how to log into the dynamic dns service. This should be the account information you used when you signed up. This is also why you should use a unique password...it will be stored and transmitted in clear text! host=myhostname.dyndns.org should match the host name you chose on with the dynamic dns service. You can have more than one per account, so you need to specify which one you're updating.
interface specifies the interface with the IP address you're tracking...make sure to use your ISP interface! max-interval controls how often updates must be made...don't make it too small or your service provider may not be happy. run-as-user=ez-ipupd is a security feature telling the program not to run as a privileged user. Finally, daemon tells the service to run in the background. Uncomment this for daily use.
Now we can start the service to test it:
Firewall:~# /etc/init.d/ez-ipupdate start
That should do it. Check /var/log/syslog for the program messages. It will tell you if you've successfully updated your record or if there was an error that needs fixing. Your IP will now (soon) be accessible via your domain name, anywhere in the world! One important note: DNS records take some time to propagate globally. Even if your client works perfectly it may take an hour or two to actually see changes around the internet. Sometimes you just have to be patient.
|
|
|
|
|
|
Proceed to Step 13 - IPSec VPN |
|
|
|
|
|
|
|
|
|
|
| Copyright © 2006 Matt LaPlante. All rights reserved. |
|
Page created in 0.0019 seconds.
|
|