admin管理员组文章数量:1026900
I'm going to move a website to a new server with a different IP address. I have copied all files and data and it's working well. I tested this by editing the hosts file so that I could see the new server while it wasn't public yet.
Now, I'm going to change the A and AAAA records for the website to point to the new server. They both have a TTL of one hour. I believe this means that a client may wait a maximum of one hour to renew the cached DNS records. However, I want to send my visitors directly to the new site. I was thinking of building a small webpage on the old server like this:
The site has been moved and is currently unavailable to your puter.
<a href="/">Try again</a> in one hour.
It would be great if I could add some client-side code to tell the client and/or the client browser to flush its DNS cache. Is something like that possible?
I'm going to move a website to a new server with a different IP address. I have copied all files and data and it's working well. I tested this by editing the hosts file so that I could see the new server while it wasn't public yet.
Now, I'm going to change the A and AAAA records for the website to point to the new server. They both have a TTL of one hour. I believe this means that a client may wait a maximum of one hour to renew the cached DNS records. However, I want to send my visitors directly to the new site. I was thinking of building a small webpage on the old server like this:
The site has been moved and is currently unavailable to your puter.
<a href="/">Try again</a> in one hour.
It would be great if I could add some client-side code to tell the client and/or the client browser to flush its DNS cache. Is something like that possible?
Share Improve this question edited Jun 22, 2013 at 10:05 asked Jun 22, 2013 at 9:54 user1544337user15443372 Answers
Reset to default 4Theres no way to flush a clients DNS records. But if your old server will let you, you could use an .htaccess file to rewrite the request to the new server and add a 301 permentantly moved status code.
If you don't have access to the actual web server, then you could use a page like that. Or even put a javascript redirect after 3 seconds to the new server.
But really, I would think it wouldn't hurt to just leave the old files. Update both for the next week or so to make sure the DNS changes for everyone, and then do whatever redirection you want to. It should make the transfer seem a bit more seamless. That is, unless you changed servers to add a new feature of some sorts that you couldn't on the old one.
But generally, its bad form to just tell people to e back in an hour. Maintenance screen are sometimes necessary, but you can definitely damage your traffic and user base by doing it.
With Firefox, dns.resolve()
can refresh DNS of Browser.
Check https://developer.mozilla/en-US/docs/Mozilla/Add-ons/WebExtensions/API/dns/resolve
I'm going to move a website to a new server with a different IP address. I have copied all files and data and it's working well. I tested this by editing the hosts file so that I could see the new server while it wasn't public yet.
Now, I'm going to change the A and AAAA records for the website to point to the new server. They both have a TTL of one hour. I believe this means that a client may wait a maximum of one hour to renew the cached DNS records. However, I want to send my visitors directly to the new site. I was thinking of building a small webpage on the old server like this:
The site has been moved and is currently unavailable to your puter.
<a href="/">Try again</a> in one hour.
It would be great if I could add some client-side code to tell the client and/or the client browser to flush its DNS cache. Is something like that possible?
I'm going to move a website to a new server with a different IP address. I have copied all files and data and it's working well. I tested this by editing the hosts file so that I could see the new server while it wasn't public yet.
Now, I'm going to change the A and AAAA records for the website to point to the new server. They both have a TTL of one hour. I believe this means that a client may wait a maximum of one hour to renew the cached DNS records. However, I want to send my visitors directly to the new site. I was thinking of building a small webpage on the old server like this:
The site has been moved and is currently unavailable to your puter.
<a href="/">Try again</a> in one hour.
It would be great if I could add some client-side code to tell the client and/or the client browser to flush its DNS cache. Is something like that possible?
Share Improve this question edited Jun 22, 2013 at 10:05 asked Jun 22, 2013 at 9:54 user1544337user15443372 Answers
Reset to default 4Theres no way to flush a clients DNS records. But if your old server will let you, you could use an .htaccess file to rewrite the request to the new server and add a 301 permentantly moved status code.
If you don't have access to the actual web server, then you could use a page like that. Or even put a javascript redirect after 3 seconds to the new server.
But really, I would think it wouldn't hurt to just leave the old files. Update both for the next week or so to make sure the DNS changes for everyone, and then do whatever redirection you want to. It should make the transfer seem a bit more seamless. That is, unless you changed servers to add a new feature of some sorts that you couldn't on the old one.
But generally, its bad form to just tell people to e back in an hour. Maintenance screen are sometimes necessary, but you can definitely damage your traffic and user base by doing it.
With Firefox, dns.resolve()
can refresh DNS of Browser.
Check https://developer.mozilla/en-US/docs/Mozilla/Add-ons/WebExtensions/API/dns/resolve
本文标签: javascriptIs there a way to flush the DNS of a client (browser)Stack Overflow
版权声明:本文标题:javascript - Is there a way to flush the DNS of a client (browser)? - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745654325a2161507.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论