Solved Test Site after moving to New Server

llamprec

Verified User
Joined
Apr 6, 2022
Messages
38
Greeting you clever people,

I am in the process of adding new servers into my network. I am then moving my DA installations away from the old machines to the new machines.
The issue that I have is how to test the site on the new machines while the old machine is still active in DNS.

How can I test each domain locally without having to change the DNS entries.
I tried adding the new ipaddress and the URL to my local hosts file, but this does not help me.
When I open the URL in my browser, it still uses the DNS lookup to resolve the site.

I really appreciate all the advice I can get.
Thanks
Lawrence
 
Changing your local hosts-file should work, add the following entries and surf to the URL:

Code:
123.123.123.123     domain.com
123.123.123.123     www.domain.com

If you ping the domain, do you get the new server IP back?
 
@wtptrs
Thanks for your response.
What you suggested is what I did.
If I ping the domain then I get the new ipaddress, but if I do an nslookup I get the old address.
If I try in a browser, then it seems to always go to the old address.
I tried to move the index.php file away from the root dir and that made no difference. the page still opened successfully.
So I assume that the page is not using the local hosts file for resolution. Very confusing and frustrating.

Lawrence
 
nslookup does not use the hosts file, so it will still return the live IP.

If you can ping to the new IP, you should be good. Try to surf in a new browser or in a private window, your browser cache may still be loading the live page.
 
Using an incogneto browser seems to have done the trick. A normal browser seems to force the DNS lookup.

Thanks for the help and advice.
Thanks
Lawrence
 
Back
Top