Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

It seems that certain home router firmware is designed to work with Dynamic DNS services (e.g. noip & dyndns) to serve a subdomain from a server behind a consumer ISP. On a similar note, are there any dynamic dns services that will work with a shared web hosting account?

Example

For instance, Dreamhost has an API that can retrieve a domain name's IP address. In theory, the dynamic DNS service would periodically make a request to the Dreamhost API for the website's IP address. If the IP address on Dreamhost changes, the DNS host would automatically make the necessary changes to the zone file for that website as soon as it notices a discrepancy.

Why?

In the past, I had paid for a static IP address on a shared host, my domain name was registered at GoDaddy and the nameserver was set to EveryDNS. Due to catastrophic hardware failure at the shared host, my site was moved and the IP address changed.

In the example setup above, the DNS records would have automatically updated. Instead, I had to manually update my A record.

Question Summary

  1. Is there a Dynamic DNS hosting service and shared web host that will allow this?

  2. Is the solution proposed in the above example viable?

  3. Bonus (at the risk of exposing my ignorance on this subject): are there any other ways, outside of DNS, to detect the IP address for a website? Perhaps a script in your shared hosting directory could detect an IP change and notify the DNS host?

Thanks in advance!

share|improve this question
    
Does your web host really change the IP address, or are you just making assumptions? Hosts that change IP addresses create issues for all the clients on that address, so it's pretty unusual. –  John Gardeniers Jan 28 '11 at 2:19
    
Yes, it has happened (see experience under "Why" above). I imagine you are correct that it's not common, but when it does happen, Dynamic DNS that works with a shared host might be handy for a couple of reasons: (i) running 30 websites without the ability to bulk update DNS records would be a pain in the behind and (ii) it's nice to have one less thing to worry about. On the other hand, maybe this is more trouble than it's worth. Thoughts? –  joelhaus Jan 28 '11 at 3:29
1  
If bulk DNS updates are what you're after, there's a third option. Set up one A record in DNS that points to your shared server, and make your 30 other websites CNAME to that. If the IP changes, you only need to update it once. –  Nic Jan 28 '11 at 4:37
    
@John I actually had it happen to me twice at one web host. It's rare, but not unheard of. And yes, I've changed hosts since then. –  Nic Jan 28 '11 at 4:39

4 Answers 4

up vote 3 down vote accepted

You've already mentioned DynDNS, it sounds like all you're missing is the client. They mention a couple linux-compatible clients on their website.

  • ddclient
  • inadyn

Using either of these in combination with a dynamic DNS service should accomplish what you want.


I originally assumed that your shared hosting would provide you with shell access. Without shell access, things get a bit tricky. First, you need some way to run a script periodically. Some web apps implement "fake cron" by calling a routine on every page load, but that won't help when your site isn't accessible. That means you need access to the crontab.

If you have the ability to run a task periodically, you could develop a script that sends the new IP address to another host you control, which is also the authoritative DNS. The receiving host would use the new IP address to update the zone file, then reload the DNS configuration.

TL;DR No, I don't know of any service that already provides this.

share|improve this answer
    
Thank you for the answer Nic, next step is to figure out how to configure that software... and as John Gardeniers alluded to, if it's even worth the trouble. –  joelhaus Jan 28 '11 at 3:42

vaguely this could involve using php or some other scripting language to get an ip address (since its shared hosting you'd have a very limited amount of choice) and somehow grabbing that ip address and passing it on to a DynDNS script - presumably doing something with curl and php if its available. Sorry for lacking precision, but shared hosting is REALLY limited, and you don't have too many tools at your disposal.

share|improve this answer

periodically make a request to the Dreamhost API for the website's IP address. If the IP address on Dreamhost changes, the DNS host would automatically make the necessary changes to the [DNS] zone file

Nope, that doesn't exist.

What does exist, however, are 3rd party services which monitor your website by making HTTP requests, and change DNS when your webserver is down. However, these aren't 'automagically' integrated with your web host, and will not know if your web host has set up a new server for you. You will have to run 2 or more webservers yourself (using for example 2 different web hosts), and let the service fail over to a server designated by you.

Examples of such services are DNS Made Easy's DNS failover, and EdgeDirector together with their monitoring service. There are several others who offer something similar, typically at a higher price.

Please note, using DNS 'tricks' is not a perfect solution for high availability; because DNS records are cached by ISPs and web browsers. Thus a unknown number of your users will not be directed to the backup server right away, it will take some time.

You could also look at CloudFlare. They don't operate by 'dynamic DNS' as you asked about, but proxy your content through their network of nodes. However, they can to a degree provide service from cached content even if your server is down.

share|improve this answer
    
CloudFlare looks interesting, will check it out. I think that DNS failover could be a partial solution for at least some redundancy with something like rsync, but I'm still a little surprised that more DNS hosts and web hosts haven't teamed up to create a standard or actually offer some sort of dynamic DNS service. It seems like both parties would benefit from something like this (one less obstacle to switching from a shared hosts nameservers and fewer hardware management concerns for shared web hosts). Thank you for your input Jesper. –  joelhaus Jan 28 '11 at 4:05

So far it has happened (to you) just once and that was for extraordinary reasons. Considering the drawback of dynamic DNS I really don't think it's worth the bother. If you still want to do it anyway just get one of the DDNS clients and run it on the server itself, as that's the only place it will work correctly.

If you are seriously concerned you should also implement some form of monitoring to ensure the server is reachable and have it alert you if it's not.

share|improve this answer
    
Thank you John, given your reputation score, I'm going to take this advice and skip going the DDNS route. I'm really not experienced enough to make this judgment, so I definitely appreciate the recommendation. Cheers! -- P.S. I'd upvote you, but my rep is too low. –  joelhaus Jan 28 '11 at 4:25
    
@joelhaus, thanks but don't put too much store in rep scores. You'll soon get to know those who are really the experts. ;) –  John Gardeniers Jan 28 '11 at 6:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.