views:

317

answers:

2

Hi all,

I was wondering if it's possible to dynamically add subdomains that point to dynamic IP addresses, and how I would go about doing that? In other words, "how is dyndns/no-ip implemented" :-)? (The part I don't get is adding/changing the DNS entries... I understand how the client sends a packet every few minutes -___-). I can tell all my users to just use DynDNS/No-IP, of course, but having it integrated with the application would be much cooler.

Thanks, Robert

+2  A: 

As you've partially said, the way DynDNS and other dynamic IP services work is that they update their server's DNS records based on a heartbeat from a client every few minutes.

The trick is that they use extremely short TTL times so that caches for the record expire very quickly and need to re-query the DynDNS server (which makes dynamic IP changes propagate quickly).

If you wanted to implement this, either find a DNS host that offers an API, or programatically update the DNS on your own server with a short TTL.

routeNpingme
awesome; thanks... Do you know any host that provides cheap DNS hosting with an API?
Robert Fraser
The cheapest would be your own if you already have the server (i.e. use Windows 2003 DNS and update the records via WMI), but if you like surfing, I hate sending you to Slashdot, but here... ;) http://ask.slashdot.org/askslashdot/08/09/24/2215226.shtml
routeNpingme
Well, it's an open source project, so... :-)Thanks so much for your help! I think I'm beginning to understand this all now!
Robert Fraser
+1  A: 

To be able to directly update/control where a domain/subdomain resolves to, you must have your own name server. When you register a domain under a TLD (for example, .com), that TLD has a nameserver. Anytime a client needs to look up the IP to something.com, they ask the .com nameserver where to find the nameserver for something. That nameserver in turn returns data about the domain or subdomain.

When you register a domain at a place like GoDaddy or Network Solutions, and you use their online tools to point your various subdomains to IP addresses, you are creating entries on their nameserver. When a client requests your domain, the root nameserver tells them to check with GoDaddy's nameserver. If you look through the configuration options of your registrar, you'll generally find a place to specify your own nameserver instead of entering domain IPs. Setting that will tell the chain of nameservers to defer resolution of your subdomains to that nameserver. Obviously at that point, having direct control over the mechanism of name-address resolution, you can do whatever you like.

Here's one list of open-source name servers. There are many others, ranging from free OSS to custom, proprietary and very expensive. Technically you could also write your own, as BIND is a public, standard format.

Rex M
Thanks for explaining this all!
Robert Fraser
No, the term "root nameserver" is completely wrong in this context. It should be "TLD nameserver(s)".
bortzmeyer
@bortzmeyer wow, yeah that makes the entire explanation just unhelpful doesn't it ;)
Rex M