I have a website which has recently migrated to a new server. The old server has a proxy_pass in place in the nginx config to ensure any requests that land there due to old DNS get routed to the new server.

It's been a few days now and I'm still seeing some traffic hitting the old server in the access log.

Is there a particular header that could be added to the response served from the old server to indicate that the IP for that host should be refreshed? Perhaps a Cache-Control: no-cache or Expires? Or maybe a header which indicates the new IP?


No, this is controlled by the TTL value you set in DNS.

You should always lower it BEFORE changing IPs so that you don't have as long of a time waiting for everyone to pick up the new address once you do change it.

  • 2
    I would add that even if such a response header existed, there would be no clean way for the client to make use of it. The client doesn't control for how long the IP is cached by the DNS recursor. And in some cases the client isn't even connecting directly to the IP address of the server.
    – kasperd
    Mar 4 '16 at 18:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.