-1

We are getting ready to migrate our website from one hosting to AWS, which means we need to change the IP of our domain and that takes time to propagate. DNS checkers report TTL 3600 for that domain which is not to bad. However, there is a possibility that it might take longer or during that hour people will visit the old server because of caching. We've realized that any changes on the domain registrar level will take time and probably won't be a good solution. Changing down the TTL also takes time (even though is not even allowed by the registrar ). Changing the NS also would take time and people might still visit the old server. Changing the domain registrar would further take long time to complete.

The question is how to redirect people who visit the old server to the new server/IP during the DNS propagation time? Is there a way to do this by using some kind of local server DNS or Apache redirect on the old server level to the new IP/server?

FB TKO
  • 3
  • 1
  • I don't know too many registrars who prevent you from changing the TTL to a lower value. Godaddy or any of the affiliates allows this on their nameservers. I think mine goes down to 10 minutes. You typically have to select the `custom` parameter when editing the TTL. – Panama Jack Jan 22 '15 at 19:25
  • @Panama Jack: if you knew DNS, then you'd know that a TTL less the 3600 doesn't serve any useful function. – symcbean Jan 22 '15 at 19:44
  • @PanamaJack I can't seem to find how to do it on 1&1, but that also wouldn't be faster, and users would potentially get to the old server in between time. Even though that sounds like a good idea to do few days prior the IP switch, to allow some time. – FB TKO Jan 22 '15 at 19:47
  • @symcbean Just because I didn't give him step by step instructions doesn't mean I don't know what I'm talking about. I've worked at hosting companies and typically if they reduce their TTL a couple days before updating the record, it literally can propagate in 5 minutes. It a **TEMPORARY** setting. Maybee you might need to read up on DNS. https://topwebhostingdelhi.wordpress.com/2013/01/31/how-to-speed-up-dns-propagation/ – Panama Jack Jan 22 '15 at 19:52
  • @FBTKO yes there is a chance within the few minutes that they can hit the old site, but I believe with your current setup, there isn't much you can do. Is your site database driven? What is difference about the old site and the new site? – Panama Jack Jan 22 '15 at 19:57
  • @Panama Jack: when I have moved sites, I see hits at the new address almost straight away too - and setting a short TTL moves people sooner - but I still see hits on the old site 3 hours after the expiry (indeed I see them longer after that, but they tail off rapidly at 3 hours, regardless of the TTL). And thats what other people tell me they find too. Personally I prefer to look at RFCs to find out how the internet is supposed to work rather than blogs - but I am painfully aware that this is an example where there are a LOT of systems which don't play nice. – symcbean Jan 22 '15 at 20:06
  • @symcbean seems my comment didn't post. I understand that some servers don't play nice as well but one method I described below has gotten me around rogue DNS servers for the most part. – Panama Jack Jan 22 '15 at 20:23

2 Answers2

0

Let's say that you have:

www.example.com CNAME web.oldisp.com

and you are mving to:

www.example.com CNAME node123.aws.com

If you set up a second (new) record, say:

www-aws.example.com CNAME node123.aws.com

Then redirect all the traffic arriving at web.oldisp.com (addressed to www.example.com) to www-aws.example.com, then the requests will be sent to the right place. The only problem is whether the server at node123.aws.com will respond to requests addressed to www-aws.example.com, and whether the responses contain references to www.example.com. You can test this out with an entry in your hosts file.

Leave it like this for a day or so after the switch over, then you only need to worry about anyone whom may have bookmarked www-aws.example.com - then you add a redirect rule to redirect any such traffic to www.example.com

symcbean
  • 47,736
  • 6
  • 59
  • 94
0

Personally what I do so I don't have to do all that renaming and adding different DNS records is leave both of the sites in place. Old and New.

Setup the new server to the point it's ready to take traffic. Doing this at night, I update my DB config file on the OLD server to point to the new DB server using the IP address. (Putting up a new maintenance page for a couple of minutes if I need to.) But usually that's instant. Don't forget to give the new DB access permission from the old server IP. Then the new DB server is actually handling all the current traffic. If if they hit the old site.

Then switch my IP in the A record in DNS after having lowered the TTL a few days ago. While the propagation takes place over say 10 minutes. Hitting either site won't matter as anything that is done is using the new DB server and will just seamlessly go to the new server once all DNS servers catch up. 24hours time should be more than enough to keep both up.

Panama Jack
  • 24,158
  • 10
  • 63
  • 95
  • In my case I personally wouldn't have both websites run out of the same DB at the same time cuz they both might send out emails so customers will receive duplicates and also duplicate crons and so on. I need only the new one working to avoid duplicate tasks. – FB TKO Jan 23 '15 at 22:11
  • @FBTKO sure, everyones set up is different so you do what you need. – Panama Jack Jan 23 '15 at 22:13