title: How to get server ip address in Spring Boot Environment?
body: <p>I'm using Spring Boot Environment to get the server port as follows </p>
  
  <pre><code>@Autowired
  Environment environment; 
  
  environment.getProperty("local.server.port") 
  </code></pre>
  
  <p>It works </p>
  
  <p>However, I can't figure out how to get the ip </p>
  
  <p>I tried these </p>
  
  <pre><code>environment.getProperty("local.server.address") 
  environment.getProperty("local.server.ip") 
  environment.getProperty("local.server.host")  
  // and many other combinations but can't make it to work 
  </code></pre>
  
  <p>What is the property name for the ip? </p>