title: Linux: Hostname to Spring Cloud Web Application not recognized
body: <p>I have a development environment in windows where I can access the spring build in both IP Address and Hostname(PC-Name) for my Eureka Config Server / Client. When I move it to the RedHat environment it does not recognize the URL if it is a hostname.</p>
  
  <p>My main goal is to change the eureka client status page to point to the hysterix monitor for the eureka client's hysterix stream. The value of <strong>${spring.cloud.client.hostname}</strong> resolves to the hostname. I was wondering what is the way to make it the current IP of the eureka client?</p>
  
  <p>To be exact here is an example of what I want am trying to do.</p>
  
  <pre><code>eureka:
   instance:
    preferIPAddress: true
    statusPageUrlPath: http://${spring.cloud.client.hostname}:${eureka.cloud.config.port}/hystrix/monitor?stream=http%3A%2F%2F${spring.cloud.client.hostname}%3A${server.port}%2Factuator%2Fhystrix.stream
  </code></pre>
  
  <p>It just so happen that the client and the server are both in the same machine so I am contented in using the client hostname for both the <strong>Eureka Config Server</strong> path and the <strong>Eureka Client hystrix stream</strong>. </p>
  
  <p>Note that I already set the <strong>preferIPAddress</strong> to true but the generated hostname is still the value of "/etc/hostname". I saw some solution that explicitly specifies the IP Address in the Eureka Client Instance. But I prefer to make it dynamic so that the same code can run smoothly on either Development and Deploy environment.</p>
  
  <p>What can I do so that the hostname can also be recognized the same as the ip address?</p>