Score:0

If I relocate my website's server (changing the IP in the process), will my users be able to access it under the same domain?

qa flag

If I first publish my website from my server which is in city A, and then move this server to city B (which I expect to change its IP address), will the website's users still be able to access it under the same URL? I'm thinking about this problem from the point of view of DNS - I expect to be able to change the mapping of this (theoretical) website's domain to the new IP address with the domain registrar, but I'm worried that some users which have visited the website prior to the relocation will be pointed to the old IP address.

I've heard that DNS mappings are "cached" and that this cache expires only after some time which could lead to the pre-relocation users not receiving the new IP address information, but I was unable to find any information specific to the aforementioned case.

To summarize, do I have to worry about the pre-relocation users not being able to access the website through the same URL after the relocation and the change of the IP address? If yes, then what could I do about it?

(Side question: Would an ISP allow me to retain the same IP address after the relocation to the new city? What about moving to a different country? I'm asking this because if I could retain the IP then any trouble with the cache or whatever would avoided.)

Score:1
za flag

You update the DNS of your domain with the new IP address:

For example, instead of

example.com. IN A 192.0.2.1

you put

example.com. IN A 198.51.100.1

Users who were accessing example.com will continue to access it by the same name; the change of IP address will be transparent to them. This is the purpose of DNS: to be able to use a fixed name even if the IP address could change.

Various visual DNS editors that are present in various web panels allow such change too. There will be some "DNS caching" issue, which is caused by the fact each record has also a TTL (time to live) setting, and DNS servers may cache it for that time. During that time, some users will access new IP (if their DNS server doesn't have the old record in the cache), while some users will still try to reach the old IP. The site won't work for those who have cached old address until cache expires, that's the worst thing you should encounter. This downtime is usually from 2 days down to 1 hour. You can check yours with various DNS tools (find a DNS looking glass and enter your site name; it should display the TTL, amongst other information).

A preparation is possible that can make the downtime last only a few seconds for outside user. You need to setup reverse proxies both on the old IP and the new IP and make the real server their backend. Then, regardless of which IP is returned to the user, the reverse proxy will be operating at that address and it will know where to find the real server. When you move the server changing its address you simply update the configuration of reverse proxies, which is possible to do almost instantly. Then you update the DNS and, when the TTL of the record expires, you may revert the setup to no-proxy if you like. This requires something operating on both places simultaneously, but if downtime is critical, it is the way to go.


If you change ISP and your IP was bound to ISP, you can't retain it. (Most likely you don't have a provider independent address; if you were, you probably had also an IT department which knows what to do anyway.) As for changing city but keeping same ISP, you should ask them, because sometimes there is a technical possibility to move IP with you. But don't rely on this! And, I believe, no ISP will span countries and allow you to keep IP address.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.