If we retain the old IP when we transition a website to a new IP, would browsers/ISP servers be smart enough to refresh the DNS record if the server using the old IP is offline?
Asked
Active
Viewed 38 times
1 Answers
3
No, they would not.
DNS works completely independent from the application. DNS would resolve, and the application would just show that it can't connect.
If you plan to migrate a DNS entry to a new IP, reduce the TTL beforehand.
After the migration you can increase it again.

Gerald Schneider
- 23,274
- 8
- 57
- 89
-
I thought that could be a nice feature. Is there any reason this is not a common practice? (Assuming browsers/DNS servers can rate-limit the DNS queries for the case when a website is simply offline) – Zack Light Jan 11 '22 at 09:27
-
2It's just not feasable. DNS requests work through a long chain of involved services, every one with it's own cache. There is no way for the application to control this. – Gerald Schneider Jan 11 '22 at 09:30
-
Sorry, I think I am missing something. For "www.example.com", I think the application can just ask the top-level domain registry (for "com") for the authoritative name server of "example.com". Then the application can get the CNAME record of "www.example.com" from the name server, whose value the domain owner should have updated to be the new IP. The application can then use the new IP. – Zack Light Jan 11 '22 at 09:44
-
For the applications the sequence is almost always `the server is not working` `==>` `throw error message` and hardly ever `the server is not working` `==>` *"initiate debugging protocols"* and then run a whole sequence of tests to isolate a root cause ***and*** attempt work-arounds. You of course design your application to do so, but generally when the server is not responding, an error telling you that is "good enough". A server being down is also much more common than operators changing an IP-address without any mitigating measures for users still using the old IP-address. – Bob Jan 11 '22 at 10:16
-
@ZackLight That's not how DNS works. – Gerald Schneider Jan 11 '22 at 10:21
-
@Bob that makes sense. Glad to hear that this theoretically somewhat could work. – Zack Light Jan 11 '22 at 10:24
-
There are multiple layers here - the application usually asks the networking layer of the OS which in turn asks a recursive server which in turn asks the root servers. Nothing is really standardized - on Linux for example there are at least 2 different APIs with multiple implementations each that an application could use. It is impossible to change anything. – mmomtchev Jan 12 '22 at 00:33