Do Google Compute instances have a stable public DNS name?

前端 未结 2 1409
醉梦人生
醉梦人生 2021-02-08 13:18

This is a question in two parts:

  • Do GCE instances have a stable public DNS name? The default DNS name for instance with public IP a.b.c.d seems to be d.c.b.a.bc.go
2条回答
  •  花落未央
    2021-02-08 13:42

    reverse lookup is okay to do, for IP address you would probably prefer using gcutil https://developers.google.com/compute/docs/gcutil/tips

    EXTERNAL_IP=$(gcutil getinstance --format=csv --zone=[your_zone] [your_instance] | grep external-ip | cut -d "," -f 2)

提交回复
热议问题