How to by-pass local domain to IP resolution?

#1
I am migration a site to my OLS server.

The NS records still point the domain to the old server IP.

I use my local hosts file to access the new site on the OLS server IP whilst I am setting it up.

I have run into an issue though. It would appear the new OLS server automatically resolves the domain to its IP address. It is not doing an NS lookup for this information.

This makes it impossible for me to do various imports from the old server to the new one, because the new one will try to find the import origin on its IP address, rather than the IP address the domain should be resolving to based on its NS records.

I tried adding an entry to the /etc/hosts file on the OLS server, pointing the domain in question to the correct IP address. But this had no effect.

Is there a way around this, or something I am overlooking that I can modify?

The server is on Ubuntu 18.10.
 
#2
Okay. Seems it just required some time to take effect. Not sure why. I even tried clearing the DNS cache on the Ubuntu server. But... some times later (I only rechecked a few hours later) the domain is now resolving to the IP in the hosts file.

Can anyone explain how long the delay is, and how to get around that in the future? (for changes in the hosts file to take effect)
 
Top