Different A record for root domain

Hi there! I have a website hosted at an ISP (henceforth referred to as the ISP) which I test-migrating to Google Cloud. I have updated its nameservers to Cloudflare, which has several A records for the subdomains and A record for the root domain, all pointing to the same old ISP’s IP.

Now, I have added a new test subdomain A record pointing to the new Google IP, and it works fine, serving the site from the GCP. Then i tried changing the A record for the root domain too to point it to the new GCP IP (without changing all the other records for subdomains), but it does not seem to work - trying to ping/wget/curl the site by its root domain name still connects to the old ISP IP.

To be perfectly honest I am not sure how exactly this is supposed to be done, and I guess I might have missed an important step, or do something incorrectly - but have no clue what that might be. Would appreciate any ideas/pointers what else might need to be done?

Thanks!

Omg, never mind, my mistake - completely forgotten that at one point I have added the root domain to my /etc/hosts, pointing to the old IP. Once I removed it from there, everything works perfectly fine, no problem at all. :facepalm:

3 Likes