I know there are numerous web pages that show site propagation…
I am curious to know if it is possible to add additional index.php script to email, create a file or some method to register when the site is available on the new server.
Would the PHP function dns_get_record() help, John?
Edit:
You could write a cronjob to test the DNS records and email you when they change. Of course, it may have propagated by the time you finish the script!
Edit:
Using this function is far better than seeing a representation of the global router results.
The function tests whether the relevant sites have been propagated to my server and reduces the possibilities of where the actual problem arises if the site does not render.
I was surprised at the difference amount of time the sites took to propagate. Some were very quick (only minutes) while others (Godaddy) took hours
The Internet has certainly improved since the recommended wait time used to be about 48 hours.
What are you trying to achieve? The function you presented will certainly work but during the propagation period its results will depend on the location of the server you will run it on and other factors like dns caching. The fact that your function will report that a website of yours has been propagated only means it is seen as propagated on that server only and other people connecting from other locations may still see the old site.
That’s why services like https://whatsmydns.net are supposed to give you a more global and true picture of propagation status. However, from my experience I’ve noticed that https://whatsmydns.net reports dns changes very quickly - usually within a couple of minutes, sometimes up to half an hour, which is misleading because I can see that from some ISP’s I have access to the propagation can take many hours. So now I treat https://whatsmydns.net mostly as a way of checking whether I have configured dns records properly for a domain and accept the fact that I have to wait a lot longer for the propagation to be completed fully.
The propagation progress is best seen though observing server logs both on the old and new server. You can see how gradually the traffic on the old server decreases while on the new server increases. From my observations about 95% of propagation completes within 24 hours and can still see some small traffic to the old server on the following day and usually after 48 hours (sometimes a bit longer) it’s gone completely.
Basically I was trying to get a dozen sites working on a new server and to know when to start testing if the site did not render correctly.
One problem encountered was a site failed because a cache directory did not have sufficient permissions. Blank screens are not helpful and checking logs only works if the site has been propagated to the new server.
Using the test routine ensured the new site had propagated and a simple “hello world” index.html proved the site was ok up to that point. Further tests could then be made to test databases, caching, cron jobs, etc.
I appreciate the test function is only for the new site and was quickly able to resolve conflicts within minutes. Once the new site was ok, routing should propagate eventually for the remaining global routers.
Previously changing servers had taken quite some time, even days because I did not know if, when and where the changeover was failing.
Edit:
Forgot to mention about having to re-initialise LetsEncrypt Certbot because each HTTPS Certificate is site specific
I see, so if you want to check the propagation on your own computer or server for testing purposes then this function will certainly work.
What I often do when changing servers is insert a small and harmless element on the site on the old server, for example add a dot somewhere on the page or change the colour of menu items, etc., something visible - in this way when I load the page in a browser I can see immediately whether I look at the old or new site.
Also, I’ve noticed that if I want dns to be propagated quickly to my ISP I should avoid visiting the site for some time before the dns change so that my ISP and proxies don’t cache the dns entries. If I’ve just visited the site then I’m sure I’ll have to wait a few hours to see the change. But even then there is a workaround - after about an hour after the dns change I configure my system to use google’s (free) dns servers and then to those dns servers my site visit is usually seen as the first one so the host is resolved anew instead of from a cache and then I have access to the new site much sooner than if I had used default dns configuration in my system.