We're installing the agents and manually configuring the CP_LIST to point to the host name of the automation engine server/ports. After the agent is started, the CP_LIST automatically changes the listings under the CP_LIST to point to the IP instead of the hostname.
Purpose: to match with external failover by using multiple IP addresses for one server name.
Please find the answer to your question under the ini config of Automation engine (ucsrv.ini) with the parameter "hostname" :If you use this parameter, the UserInterfaces, CallAPIS and agents receive the information about the CPs that are known in the system via host name and port and not via the IP address and port during the CP selection phase while the connection to the Automation Engine is being established.
In doing so, you can avoid firewall and other NAT problems.