开发者_运维知识库
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this questionAround 24 hours ago I set a new IP address for the A record on my website and it appears to be working well by pointing visitors to that new IP address. But, sometimes it still points users to the old IP address which is now set up as a restricted access test environment. How can I go about ensuring that only the new DNS A record are sent to clients? How can I refresh/flush the DNS on the server?
EDIT: Can one lower the timeout BEFORE the IP change so that they flush the old one sooner? How?
Looking at the SOA record for the domain:
primary name server = ns21.ixwebhosting.com
responsible mail addr = admin.ixwebhosting.com
serial = 2011060963
refresh = 10800 (3 hours)
retry = 3600 (1 hour)
expire = 604800 (7 days)
default TTL = 86400 (1 day)
The default TTL says that anyone can cache the result for up to 1 day. Besides the refresh says that a slave server should get new data from the master every three hours, so you have to wait at least 24 + 3 = 27 hours before you can trust everyone to have the new information.
The best way to handle this kind of DNS changes is to prepare at least 24 hours (or whatever TTL you have) ahead by temporarily setting down the TTL (maybe to 600, which is 10 minutes). Then you can do the changes and they take effect within 10 minutes. When you see that everything works and you don't need the possibility for a quick rollback, you can reset the TTL to 86400 again.
When you change the DNS on the server, the change is immediate, but for the others around the world, the DNS could take 24-48 hours to see the new change. So mainly, you have to wait :D
If you are close to your server location, it could take 2 or 3 hours but that depends on when your ISP and others ISP flush their DNS server's cache.
You can't.
DNS is a distributed system and clients and intermediary caching servers (including the root servers) will regard the cached values as correct until they timeout.
An approach to make it faster is to reduce the TTL (time-to-live) on the record well in advance of the actual change and then put it back up when you make the change. This way once the old record with a long TTL times out the caching and root will refresh more frequently from the authoritative server. But if you've already changed it, it's too late for that and you can only wait.
精彩评论