Monday 15 July 2013

javascript - Is there a way to flush the DNS of a client (browser)? -


I am going to transfer a website with a different IP address to a new server. I have copied all files and data and it is working well I have tested the host file and tested it so that I can see the new server, even though it was not public yet.

Now, I want to change A and AAAA records for the website. Both of the new servers have a one hour TTL. I believe that it means that to upgrade the cached DNS records A customer can wait for a maximum of one hour. However, I want to send my visitors directly to the new site. I was thinking of creating a small webpage on the old server like this:

  The site has been moved and is currently unavailable to your computer Is & lt; A href = "/" & gt; Try again & lt; / A & gt; In an hour   

It would be good if I could add some client-side code to the flushing of my DNS cache to the client and / or the client browser. Is such a thing possible?

There is no way to flush a customer DNS record. But if your old server will tell you, you can use the .htaccess file to rewrite the request on the new server and add the transferred status code from 301 pattern.

If you do not have access to the real Web server, then you can use a page like that or even put a JavaScript redirect after 3 seconds on the new server.

But in reality, I would think that it will not just be releasing old files for the next week or both to make sure that the DNS changes for everyone, and then whatever Also the redirection you want should move it to feel a bit more seamless. That is, unless you change the server to add a new feature of some kind, which you can not do on the old.

But generally, its bad form tells people to come back in just one hour. Maintenance screen is sometimes necessary, but you can definitely damage your traffic and user base.

No comments:

Post a Comment