I am using file_get_contents to get api result from a URL in json format. However, there is an issue in file_get_contents when i call the url. The error returns is
file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
The url im using is calling a load balancer server before forward to the main api server. If i were to directly change the url to main api server ip address, i am able to get the results. However, if i call through load balancer url it returns error message
Is it something i need to configure in loadbalancer server?
- update: seems to be a domain name issue? i tried calling using load balancer direct IP address. it is working. But when i switch back to a domain name url, it is failing.