title: Communicating between to Eureka clients
body: <p>I have two clients registered to the same Eureka server, when I check the server UI I see both clients registered fine. But when I try to call one client from the other I get IO exception: <code>ResponseEntity&lt;LoginInformationDto&gt; quoteResponse = restTemplate.exchange("http://lirs-security/api/userSecurity/validateUserToken/" + token, HttpMethod.GET,
                          null, new ParameterizedTypeReference&lt;LoginInformationDto&gt;() {
                  });
                  /** ResponseEntity&lt;LoginInformationDto&gt; quoteResponse = restTemplate.exchange("http://localhost:8103/api/userSecurity/validateUserToken/" + token, HttpMethod.GET,
                          null, new ParameterizedTypeReference&lt;LoginInformationDto&gt;() {
                  }); */</code> . When I access the other service directly it works. error: <code>org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://lirs-security/cbf69488-5624-4181-9254-ff423afa7620": lirs-security; nested exception is java.net.UnknownHostException: lirs-security
  </code> This is what my console looks like : <a href="https://i.stack.imgur.com/gJMxJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gJMxJ.png" alt="enter image description here"></a>
  I've been battling with this for days and I've ran out of ideas. I really need all the help I can get @ this point.</p>
  
  <pre><code>`#Server application.yml file
  spring:
  application:
  name: lirs-gateway
  
  server:
  port: 8101
  eureka:
  instance:
  hostname: localhost 
  client:
  registerWithEureka: false
  fetchRegistry: false
  #server:
  #waitTimeInMsWhenSyncEmpty: 0
  serverUrl:
  defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
  
  #security client yml file
  eureka:
  client:
  registerWithEureka: true
  fetchRegistry: true
  serviceUrl:
  defaultZone: http://localhost:8101/eureka/
  instance:
  hostname: localhost
  
  #Security client properties file
  spring.application.name=lirs-security
  server.port=8103
  
  spring.datasource.url=jdbc:mysql://localhost:3306/***** 
  spring.datasource.username=root
  spring.datasource.password=password
  spring.datasource.testWhileIdle=true
  spring.datasource.validationQuery=SELECT 1
  spring.jpa.show-sql=true
  spring.jpa.hibernate.naming- 
  strategy=org.hibernate.cfg.ImprovedNamingStrategy 
  
  #tax payers client yml
  eureka:
  client:
  registerWithEureka: true
  fetchRegistry: true
  serviceUrl:
  defaultZone: http://localhost:8101/eureka/
  instance:
  hostname: localhost
  
  # client properties file
  spring.application.name=tax-payers
  server.port=8102
  
  spring.datasource.url=jdbc:mysql://localhost:3306/****
  spring.datasource.username=user
  spring.datasource.password=password
  spring.datasource.testWhileIdle=true
  spring.datasource.validationQuery=SELECT 1
  spring.jpa.show-sql=true
  spring.jpa.hibernate.naming- 
  strategy=org.hibernate.cfg.ImprovedNamingStrategy
  security.oauth2.client.clientId=myID
  security.oauth2.client.scope=bigScope
  simpleProp=this is the value`
  
  `@EnableDiscoveryClient
  //@EnableEurekaClient
  @SpringBootApplication
  public class TaxpayersApplication {
  
  public static void main(String[] args) {
      SpringApplication.run(TaxpayersApplication.class, args);
  }
  
  @Bean
  CorsConfigurationSource corsConfigurationSource() {
      UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
      source.registerCorsConfiguration("/**", new CorsConfiguration().applyPermitDefaultValues());
      return source;
  }
  
  
  }
  
  @EnableDiscoveryClient
  //@EnableEurekaClient
  @SpringBootApplication
  public class LirsSecurityApplication {
  
  public static void main(String[] args) {
      SpringApplication.run(LirsSecurityApplication.class, args);
  }
  }`
  </code></pre>