Running a DNS Server with a Dynamic IP Address

     - Saturday, August 20, 2005

Well, I've really jumped into the deep end with this one. As I reported last Wednesday, the company that used to handle my DNS service was sold. Since then, I've had nothing but trouble keeping my websites up. So, I've decided to host my very own Domain Name Servers. A DNS server translates a domain name (www.somedomain.com) into the actual IP address of the website.

Hosting a DNS service by itself isn't too complicated, but remember, I have an IP address that's dynamically assigned by my ISP. Which means my DNS servers don't technically have a static place on the internet where they can be found. If the DNS server for a domain can't be found, then the website's actual IP address can't be discovered.

Running a DNS server on a dynamic IP address doesn't seem to make much sense. However, while technically I have a dynamic IP, the fact is that my IP address very rarely changes. There no redundancy in hosting the DNS on the same dynamic IP as the website, but if I lost my internet connection, or the machine crashed, well, you weren't going to find the site anyway! It's not ideal, but it's better than what I had.

DNS Server Software Install and Configuration
The whole process was pretty simple actually. First I needed software that would actually respond to DNS requests. I'm testing SimpleDNS now. It costs over $100 to purchase, so I'll probably switch to a free DNS server before the trial expires. For whatever software you use, you'll need to read the manual to get it configured right. If you want help, just ask and I'd be happy to walk you through it.

Next, I forwarded the DNS query port, port 53, through my router. DNS uses port 53, so I just went to my cable/dsl router's port forwarding configuration page, and forwarded all UDP requests on port 53 (DNS' standard port) to the machine on my network that runs the DNS software.

At this point, in theory, if a browser sent a request to my IP asking for a DNS record, say for Complex Distress, the software would respond with my IP address. But, of course, no one would be asking until I switched the nameserver information for the domain.

Creating Nameserver Hostname's
To edit the nameserver associated with my domains, I needed to go to my domain registrar's site. After all, aside from keeping a record of the domain name's owner, the only other thing a domain registrar does is point the domain to a nameserver.

However, my registrar doesn't allow IP addresses as nameserver. Nameservers themselves need to be actual domain names. Seems like we're going in circles a bit, doesn't it? After puzzling this for a bit, I realized that I could just add hostnames onto my domain name right at the registrar. A hostname is the very first part of the domain name, like this: hostname.domainname.com

I already use my EscapeOrbit.com address to sell domains and wehosting space, so it seemed like a natural fit for hosting DNS nameserver addresses. I just added two new hostname: ns1.escapeorbit.com and ns2.escapeorbit.com, and pointed them both to my IP address.

Edit the Domain's Nameservers
Then it was just a simple matter of setting those two hostnames as my nameserver's for all my other domain names. Now, when web browsers look for my site, and they ask my registrar for the nameserver, the registrar responds with the ns1 and ns2 address. From there, the browser will go ask my nameservers, which are located at my IP address, and my DNS software will respond with the IP address of the site.

Of course the IP address of the website will be the same IP address of the DNS nameserver, so this all seems a little redundant, but that's only because I'm running all of this off the same machine on the same IP address. Normally the DNS server holds information about many websites that are running on many different machines all at different locations.

Frankly, I'm pretty amazed this is all working. But the uptime of the site is perfect now instead of it randomly failing like it's been doing for the past couple weeks. I'll post separately on whatever DNS server software I settle with.

When My IP Address Changes
Eventually my IP address will change. When it does, I'll need to edit the address in two places. The ns1.escapeorbit.com and ns2.escapeorbit.com IP addresses will need to change to match the new IP address. And I'll need to let my DNS software know that the address has changed.

So, hope you're enjoying Complex Distress. I'm glad it's back up and available for you, at least until my IP address changes again!

2 Comments:

At 5:29 PM, Anonymous Jason Drohn said...

I'll tell you what, I have been thinking about running my own server for quite some time. Do you think its worth it for saving $60 or so a year? Do you resell the service, or just host your own sites?

Honestly, I love experimenting, but I am unsure if I want to go to extreme lengths only to realize that it was a waste of time!!

 
At 11:37 AM, Anonymous Anonymous said...

You could always use everydns.net for free DNS hosting. I use it and it works like a charm!

 

Post a Comment

<< Home