Cumulocity Microservice not resolving external system host

Hi all,

I have a problem with a custom Cumulocity microservice written in Python. In the microservice script, I am calling an external REST API endpoint (using Python’s requests library).

I receive an error from the microservice saying “Cannot resolve host”. However, if I use the IP address instead of the host, the call is successful.

Just to give some context, the microservice is deployed on an instance of Cumulocity Edge 10.17, installed on a specific machine. The external system I am trying to reach is on another machine, that is part of the same network. The two machines can communicate with each other, and DNS configuration seems ok. The problem only arises when the call to the external system is made by the microservice.

Am I missing something in the microservice/Cumulocity tenant configurations? The goal is using the correct host instead of the IP address of the target machine.

Any help would be appreciated, thank you

Hi @davidelh,

have you configured the correct DNS server on your edge instance?
In case the hostname you are using is only resolvable via your private DNS server and not public DNS servers, you would need to ensure that your edge instance is also using your private DNS server.

Instructions for configuring the DNS of your edge instance can be found here: Configuring Edge - Cumulocity documentation

Regards,
Tristan

1 Like