Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
Best way for a new droplet to programmatically learn its IP address
I am planning to create new droplets dynamically. They will register themselves by writing their IP address in a database. They are all going to be on a private network, so this will be the IP address of eth1 and not eth0. Is the best way for a droplet to learn its IP address to run ifconfig and parse its output, or is there a better way to do this?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×