Dynamic DNS Preparation



Dynamic DNS Preparation

Unlike DSL, most cable modem providers may not allow you to host sites at home by blocking inbound HTTP (TCP port 80) and SMTP mail (TCP port 25) while allowing most other TCP traffic through. Many DDNS providers are aware of this and provide a redirect service to bypass the problem. Under the system, Web queries first hit their servers on the regular TCP ports and then these servers automatically redirect the Web clients to use the IP address of your server on a different TCP port. Although this works well, it has disadvantages. The cost of the service can make hosting with a $10 /month virtual hosting service look very attractive, and many search engines do not index redirected pages.

Testing ISP Connectivity for Your Web Site

The very first thing you need to do is to determine whether your ISP allows inbound connections on your DSL or cable modem line. The easiest way to do this is to phone them and ask, but in some cases they'll say no when in fact the answer is yes. Here is how you can test it out for yourself.

Setup

You need to do some basic setup before testing can begin.

1.
Configure and start Apache on your Linux Web server as described in Chapter 20, "The Apache Web Server."

2.
Connect your Linux server directly to your cable or DSL modem, and configure the Ethernet NIC for DHCP as described in Chapter 3, "Linux Networking."

3.
Make sure you can ping your default gateway.

4.
Use the ipconfig command to determine the new IP address of your Web server. (This command is explained in Chapter 3 also.)

5.
From the Linux Web server itself, try to TELNET to this IP address on port 80 as explained in Chapter 4, "Simple Network Troubleshooting."

If you can get through to the IP address on port 80, then you most likely have Apache configured correctly

Testing from the Internet

You may be able to see Web pages from the Web server itself. Ask a friend somewhere else on the Internet to try to TELNET to this IP address on port 80.

If port 80 works, then ask the friend to point a Web browser to the IP address and see whether a valid Web page appears. If your Linux server will eventually be placed behind a firewall, then adjust your network topology accordingly and test port 80 port forwarding to your Web server.

If the TELNET to port 80 fails, your ISP probably doesn't allow HTTP access to its networks. Configure your Web server to run on a different TCP port, preferably above 1024. The Apache httpd.conf file uses the listen directive to do this. Change it to your new value and restart httpd:

     # httpd.conf listen directive, change "80" to some other value.
     Listen 80

Test again with TELNET on this new port. If it works, try the Web browser test too. If the test port is 1234, then use a URL of http://server-ip-address:1234.

Note

If you are running iptables, remember to adjust the rules to match this new port or stop iptables temporarily while doing this testing.


If you can get a connection with correctly displayed pages on a nonstandard port, then you can additionally sign up for a redirect service with your DDNS provider as explained earlier.

Test Port Forwarding

If your Linux server will eventually be placed behind a firewall, then adjust your network topology accordingly. Let Apache run on port 80, and test port forwarding from the nonstandard port to port 80 on your Web server from the Internet.

One of the features of the curl TRoubleshooting utility is that it allows you to download a Web page's HTML code to your screen without interpreting it. You can determine the external IP address of your router or firewall by logging onto your Linux Web server and issuing the curl command to query the DynDNS.org IP information server. In this case, you are interested in only the line that tells you what the server thinks your IP address is; use the grep command to extract just that part. In this example, the IP address is 24.4.97.110:

     [root@bigboy tmp]# curl -s http://checkip.dyndns.org/ | grep -i
     address
     <html><head><title>Current IP Check</title></head><body>Current IP
     Address: 24.4.97.110</body></html>
     [root@bigboy tmp]#

Registering DDNS

Once you decide to go ahead with DDNS, you need to choose between the broad categories of Dynamic DNS service:

  • Free Dynamic DNS: Your Web site name will be a subdomain of the DDNS provider's domain. For example, if the DDNS provider's domain is isp.net, then your site will become my-site.my-isp.net. You can perform all the necessary steps on your DDNS service provider's Web site. Remember that this type of service may be undesirable for a company that wants to establish its own corporate identity. Another disadvantage is that you must rely on your DDNS provider staying in business or else you may lose your domain. When you own your own domain this worry largely goes away as you are fully in control of the DNS registration and renewal process.

  • Paid Customized DNS: You can register the domain name of your choice and still host your Web site on a DHCP line.

If you choose to create your own domain and use a paid DDNS service, follow these steps:

1.
Register your domains (such as my-web-site.org) with such companies as Verisign and RegisterFree.

2.
Create an account with the DDNS provider, and register your Web sites (sometimes called hosts) as part of your domain (as in www.my-web-site.org and mail.my-web-site.org) with them. Your DDNS registration process will provide you with a username and password, which you'll need to use when configuring your DDNS client.

3.
Update your domain information with your main DNS registrar (Verisign and RegisterFree) to tell them to direct queries to *.my-web-site.org to the DNS name servers of the DDNS provider.

4.
Install a DDNS client on your Web servers that continuously runs, only updating the DDNS provider's DNS servers with the most current DHCP IP address of the site whenever it detects a change.

You should also be prepared for slower response times for your home-based site than if you were using a static IP and a regular DNS service.

Install a DDNS Client on Your Server

All DDNS service providers require that you use a DDNS client on your Web server that will periodically update the IP address information in your provider's DDNS record. The very popular one DDclient, for example, now comes in a RPM format.