Problem installing Windows agents after upgrade to 5.1.1

After upgrading to 5.1.1 I have issues with installing CG agents on Windows.

The error I get is:

2019-08-02 11:28:39 ThreadId: 0x00002998 INFO: RestClient::setRootAddress - Adding inet:8082.
2019-08-02 11:28:39 ThreadId: 0x00002998 INFO: AgentManager::run - Attempting to register the agent
2019-08-02 11:28:40 ThreadId: 0x00002998 ERROR: RestClient::registerAgentManager - Response Result: (6) Couldn't resolve host name
2019-08-02 11:28:40 ThreadId: 0x00002998 INFO: RestClient::nextRootAddress - The active root address is now inet:8082.
2019-08-02 11:28:40 ThreadId: 0x00002998 ERROR: AgentManager::run - Failed to register the agent

CG server runs on RHEL 7.5.