Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have changed the DNS for my domain. what code (or header) should I use in my old server to tell the visitor's browser or ISP that it should check for my new DNS and the current content is old?

is the temp redirecting to a subdomain should help?

or you know a better way?

share|improve this question
add comment

migrated from stackoverflow.com Jun 20 '11 at 9:46

This question came from our site for professional and enthusiast programmers.

4 Answers

It looks like you can not do much at the moment. You could put up a message on the old server stating that the visitor is on the old website. If you would have more control over your website then you could configure a "proxy" to the new server. But for this you need your own server and some understanding about web server software.

But something for the next time: What you should have done first was to set the time-to-live (TTL) for the DNS records down to 10 minutes or so. Usually you would do this about one week in advance of the move. And you do this on the old DNS servers. Then when the change happens it takes ideally only 10 minutes till all users visit the new website.

I say ideally because not every ISP has configured their DNS servers to respect the TTL value. Some set their own value.

If you can not change the TTL and you can not configure a proxy then you probably have a pretty cheap hosting package. So if it is really important to you that you can switch easier in general then I recommend you to plan in more money for the hosting. If your website isn't worth a lot then you have to live with the fact that switching the provider brings some problems along.

share|improve this answer
add comment

Did your ip address change and the domain name is still the same? In this case, the old dns server should return the new ip address for you domain name. If your domain name changed, you could configure your webserver, to redirect all requests from the old domain to the new domain .

share|improve this answer
    
It takes time for DNS changes to propagate -- some servers will have the older IP address cached, and may even ignore the TTL setting before trying to refresh their data from the authoritative DNS server. So it may be necessary to keep the old IP address in service for a while, until the stale DNS entries eventually disappear. –  Jim Lewis Apr 11 '10 at 18:31
    
domain is the same. the problem is that i cannot change DNS server settings. I just can change DNS for domain. –  takpar Apr 12 '10 at 9:31
    
Frankly, takpar, your comment is hard to understand. You say you cannot change the DNS but you say you changed it? Can you be more specific and provide hard details? –  bortzmeyer Apr 13 '10 at 8:51
    
@bortzmeyer, I can change DNS server for domain from NS1 to NS2. But I cannot modify settings in either NS1 or NS2. that's waht I mean. If I could modify NS1 settings there were no problem. –  takpar May 14 '11 at 5:26
add comment

Frankly, the question makes no sense.

Did you move your website from one hosting to provider to another? Then you need to log into your domain registrar and point the name server entries to the name servers provided by your new hosting provider.

Did you change the server name on the same server and keep the domain name the same? Then you need to go your cPanel (or whatever else is being used) and update your DNS entries and then wait for your hosting provider to pick up the changed information and pull it into their name servers.

what code (or header) should I use in my old server to tell the visitor's browser or ISP that it should check for my new DNS

This specifically is not allowed as a security measure, unless you actually are asking about a 301 redirect from the old server to the new server which is a HTTP server function, not DNS.

share|improve this answer
    
The address is the same, MySite.com has been in ServerA and is now in ServerB, so 301 has no meaning, I just looking for a way to force clients coming to ServerA to clear their DNS cache, so they will be updated. I don't call this a security matter. –  takpar Oct 21 '11 at 22:00
    
Sooo... To put this hypothetically so I understand. Take an ip like 127.0.0.20. Host www.example.com on ServerA. Change www.example.com over to run on ServerB with the ip assigned as 127.0.0.20. Correct? I take it from "address", you mean the actual IP address. –  Fiasco Labs Oct 23 '11 at 5:06
    
I can't just "take it" from ServerA, assume both ServerA and ServerB are a cPanel account and I do not want just to remove my account on ServerA, I just had changed DNS from NS.ServerA to NS.ServerB. so this is not a solution. –  takpar Oct 23 '11 at 17:59
add comment

There is no code or header to tell visitors of your new DNS records. You just have to wait for the new records to propagate over the web. It used to take up to 72 hours but now should be complete within minutes. Having good control over your DNS TTL is always a plus

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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