Recently, We started using kong with cassandra for the redirection of microservices requests.
We had only 1 redirection rule with an upstream url using the hostname "
abcd-prod-services.myprod.net" and it was failing. Kong seemed to return error 500 to the client.
The redirection was failing with the below error message in the /usr/local/kong/error.log.
2017/08/03 09:21:59 [error] 51005#0: *172502 [lua] responses.lua:107: before(): failed the initial dns/balancer resolve for 'abcd-prod-services.myprod.net' with: failed to receive reply from UDP server 10.20.11.2:53: connection refused, client: 10.64.70.80, server: kong, request: "POST /api/addressValidate HTTP/1.1", host: "10.155.90.11"
Note : I have changed the IP addresses in the above error message, as we are not allowed to share Production env IP addresses on the internet.
We just use the default DNS settings in /etc/kong/kong.conf.
Our Kong Server has 2 DNS Server entries in its /etc/resolv.conf file
We did not know that the first DNS Server 10.20.11.1 was working fine but the second DNS server 10.20.11.2 was down. Kong seemed to pick up only the second DNS Server 10.20.11.2 for DNS hostname resolution for the rules redirection and fail with the above error.
The regular ping and curl commands on the Kong Server work fine as the first DNS Server is working. For example:
ping abcd-prod-services.myprod.net
curl http://abcd-prod-services.myprod.net:8080/api/addressValidate
I thought kong was supposed to read and use all DNS Servers in /etc/resolv.conf for hostname resolution, for hostnames used in the API rules. We use kong version "kong-0.10.3-1.noarch" on RHEL 7.3 (64 bit) with "cassandra-3.11.0-1.noarch" and Oracle java "1.8.0_111"
Note : We got around the issue by having a local entry mapping in _/etc/hosts_ for the hostname "
abcd-prod-services.myprod.net" used in the upstreamurl.
I was wondering if anybody has any ideas about this issue.