'Name or service unknow with eureka server

I use spring boot with eureka. When I try to start the eureka server, I get

Caused by: java.net.UnknownHostException: MiWiFi-RA72-srv: Name or service not known

My config

   server:
       port: 8761
    spring:
       security:
          user:
             name: admin
             password: password
    logging:
       level:
          org:
             springframework:
                security: DEBUG
    eureka:
       client:
          registerWithEureka: false
          fetchRegistry: false
          service-url:
             defaultZone: http://admin:password@localhost:8761/eureka/
       server:
          waitTimeInMsWhenSyncEmpty: 0
          instance:
             hostname: localhost
             prefer-ip-address: true

I tried to replace localhost by MiWiFi-RA72-srv, but I get the same result



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source