DNS For Instance with ephemeral external IP

1,499 views
Skip to first unread message

David Troyer

unread,
Jan 17, 2016, 10:17:50 AM1/17/16
to gce-discussion
I was curious if there is a way to specify an external facing hostname for a compute engine instance with an ephemeral IP address? This is an instance I only spin up on occasion, so I don't want to pay for a static IP.

I've tried ddclient, but it doesn't seem to have access to the external IP address, only the internal one. I've tried looking at routing but I don't think that's what I need.

Any thoughts?

David Troyer

Kamran (Google Cloud Support)

unread,
Jan 17, 2016, 1:29:03 PM1/17/16
to gce-dis...@googlegroups.com

Hello David,

You can read the external IP address of your VM instance from metadata server. The metadata server is accessible by querying any of the following URLs:
To read the external IP address of the VM, run this curl command from inside of your instance:


Sincerely,

Kamran

Bernhard Reinel

unread,
Jun 6, 2017, 12:31:24 AM6/6/17
to gce-discussion
(Just in case you are still interested, or someone else stumbles accross this topic.)

Example for ddclient config (/etc/ddclient.conf) on GCE:

protocol=dyndns2   #Set according to your provider


ssl=yes   #Remove if you have problems using SSL (not supported with every provider)

server=<your-provider-url>
login=<your-login>
password=<your-password>


Using cmd-mode to acquire ephemeral IP from metadata endpoint.

Don't forget to adapt config in /etc/default/ddclient to run ddclient as daemon.

Best,
Bernhard
Reply all
Reply to author
Forward
0 new messages