Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Reassigned IP address from one VM to another...now DNS won't resolve.

I recently rebuilt a VM that I use for a small hosting operation in the same data center as the old VM. When I was finished I reassigned my static IP address to the new VM.

Now, Gmail or other Google services aren't resolving the DNS for the new VM. Gmail can't deliver mail to any email accounts on the VM, yet any other email service provider appears to work fine. It seems to only be a problem within the Google networks.

Any ideas?

1 1 222
1 REPLY 1

Hi @CSmith,

Welcome to Google Cloud Community!

There are multiple probable scenarios I can think of that are causing this DNS resolution issue of yours. Below is a list of the possible causes:

  1. Firewall Rules
    • Check if your firewall rules are blocking traffic to the new VM on the reassigned IP. Make sure a firewall rule allows traffic on the needed ports to the new VM’s IP address. I think you can also create a new rule if no suitable firewall rule is currently configured.
  2. DNS Caching
    • It could also be that your DNS records are cached(this is used to speed up lookups) before you moved the IP. If this is the case, those caches will point to the wrong VM. You can either:
      • Wait for the caches to expire and the new IP would then likely resolve. This would depend on the Time-To-Live of the DNS record.
      • Flush the local DNS cache. 
        • For linux, run sudo systemd-resolve --flush-caches on a terminal
        • For windows, run ipconfig /flushdns in command prompt
  3. GCP Load Balancers
    • If a Load Balancer is in play, you may have to update the backend configuration for the said load balancer to include the new VM and its IP address.
  4. VM Configuration
    • It could be that the VM is not listening on the new IP address. Ensure if the VM’s network interface is correctly configured. 

    You may also try pinging the new IP addresses from a different machine to see if this is DNS-related or a network issue. A successful ping would likely mean that the issue is DNS-related. If it fails, it may be a network issue. Also, use nslookup to see the DNS records/details to pinpoint caching issues. It would also be beneficial to check the logs of your VMs for errors.

    I highly recommend this documentation for best practices for Cloud DNS. You may also create a support case through the Google Cloud Console to get a more comprehensive support for your inquiry.

    Hope this helps.