Kong - DNS resolution issue with 2 entries in /etc/resolv.conf

1,712 views
Skip to first unread message

vishc...@gmail.com

unread,
Aug 11, 2017, 2:45:27 AM8/11/17
to Kong
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

search itsalpha.net myprod.net

nameserver 10.20.11.1

nameserver 10.20.11.2



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.

Thijs Schreijer

unread,
Aug 11, 2017, 8:07:43 AM8/11/17
to Kong

From: kong...@googlegroups.com <kong...@googlegroups.com> on behalf of vishc...@gmail.com <vishc...@gmail.com>
Sent: Friday, August 11, 2017 8:45:27 AM
To: Kong
Subject: Kong - DNS resolution issue with 2 entries in /etc/resolv.conf
 
--
You received this message because you are subscribed to the Google Groups "Kong" group.
To unsubscribe from this group and stop receiving emails from it, send an email to konglayer+...@googlegroups.com.
To post to this group, send email to kong...@googlegroups.com.
Visit this group at https://groups.google.com/group/konglayer.
To view this discussion on the web visit https://groups.google.com/d/msgid/konglayer/0c79546d-5326-4c78-905a-63cc0fc62018%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

vishc...@gmail.com

unread,
Aug 11, 2017, 9:40:03 AM8/11/17
to Kong
thanks for making me aware that it is a bug.

I am assuming that it will be fixed in the future releases of Kong.
Reply all
Reply to author
Forward
0 new messages