1

Yesterday I had to revert to a recent snapshot of my vm. This vm was working flawlessly at the time I took it.

But now I can no longer resolve any url from this host. All git pull commands, all curl requests, host lookups, etc.. are failing. For instance:

# host www.google.com
; connection timed out; no servers could be reached

Yet this host is reachable from the outside world, as I can ssh to it, and http requests coming in are being serviced.

What am I forgetting?

ChrisF
  • 57
  • 9
  • You have not provided any information about networking, firewall rules, etc. – John Hanley Feb 07 '19 at 06:44
  • @JohnHanley do you mean that I should provide networking information in this post? or that I did not provide network information to the instance? As I mentioned in the initial post, basic network and firewall settings seem to be working as I am able to ssh (port 22) from the outside, as well as through db port 3306, and http port 80. – ChrisF Feb 07 '19 at 13:02

2 Answers2

3

Turns out that the file /etc/resolv.conf has been automagically populated roughly 18 hours after spinning up the instance.

Not super convenient, but glad it is resolved.

Had I known at the time, I think I would have been able to resolve the issue by adding this to /etc/resolve.conf:

domain c.[Project ID].internal 
search c.[Project ID].internal.google.internal. 
nameserver 169.254.169.254
ChrisF
  • 57
  • 9
2

This is the expected behavior, the hostname of an instance in the GCP is provided by the metadata server. Every time an instance boots up, it will get the hostname from the metadata server, therefore resetting any changes made on the instance level, please see 1 and 2.

  • Thanks for the tip. However I am surprised that I would have to perform the zone configurations recommended in the articles your proposed. I never had to do this before on my original instance. It just worked out of the box. – ChrisF Feb 07 '19 at 13:05
  • Also, why is this simple lookup command failing? host www.google.com – ChrisF Feb 07 '19 at 13:17