Kong / lua-resty-dns-client

Lua DNS client, load balancer, and utility library
http://kong.github.io/lua-resty-dns-client/topics/README.md.html
Apache License 2.0
152 stars 52 forks source link

localhost not treated specially #50

Closed james-callahan closed 6 years ago

james-callahan commented 6 years ago

I got {"message":"name resolution failed"} from Kong when my upstream had a localhost target.

This seems to be because my /etc/hosts is empty. However it should have worked:

From RFC 6761: Section 6.3.3

Name resolution APIs and libraries SHOULD recognize localhost names as special and SHOULD always return the IP loopback address for address queries and negative responses for all other query types. Name resolution APIs SHOULD NOT send queries for localhost names to their configured caching DNS server(s).

Tieske commented 6 years ago

This seems to be because my /etc/hosts is empty

exactly. Thanks for the report