-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to fix this error:"java.net.UnknownHostException: DNS service refused [response code 5]" #315
Comments
Interesting, do you have any tcpdumps when this happens? |
Also, are you able to replicate this with coredns? (github.com/coredns/coredns) |
here is the tcpdumps: |
We block ANY in SkyDNS because it is such a useless query. (Didn't port that particular feature over to CoreDNS, because filtering is done in a separate middleware). Think in CoreDNS you'll by served Can this |
i can't find InetAddress's source code... here is my Corefile: |
[ Quoting <[email protected]> in "Re: [skynetservices/skydns] how to ..." ]
i can't find InetAddress's source code...
CoreDNS allow ANY lookup ,but find following error:
`
Exception in thread "main" java.net.UnknownHostException: DNS record not found
at sun.net.spi.nameservice.dns.DNSNameService.resolve(DNSNameService.java:186)
at sun.net.spi.nameservice.dns.DNSNameService.lookupAllHostAddr(DNSNameService.java:291)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
at java.net.InetAddress.getAllByName(InetAddress.java:1192)
at java.net.InetAddress.getAllByName(InetAddress.java:1126)
at java.net.InetAddress.getByName(InetAddress.java:1076)
at FindDomain.getHostByIPAddress(FindDomain.java:49)
at FindDomain.main(FindDomain.java:43)
`
here is tcpdump:
`
Standard query 0x8c4e ANY test.mydomain.com
Standard query response 0x8c4e ANY test.mydomain.com SOA ns.dns.mydomain.com
`
Yes, supported, but returns NODATA (I think), can't really see. What does
`dig ANY @coredns_server_ip test.mydomain.com` return?
(nslookup or ping is ok )
here is my Corefile:
`
.:53 {
etcd mydomain.com {
stubzones
path /skydns
endpoint http://127.0.0.1:2379
upstream 8.8.8.8:53
}
prometheus
cache 160 mydomain.com
loadbalance
proxy . 8.8.8.8:53
}
`
Yes, supported but not doing the right thing. We could make ANY returns all A
and AAAA records to accomodate this usecase, but I'm not a fan. Is there
anything easy on the java side that could be done here?
|
why return 'NODATA'? i already add A record to etcd. ;; QUESTION SECTION: ;; AUTHORITY SECTION: ;; Query time: 5 msec ` ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.62.rc1.el6 <<>> A @192.168.48.223 test.mydomain.com ;; QUESTION SECTION: ;; ANSWER SECTION: ;; Query time: 2 msec |
Cordns supported ANY lookup indeed! InetAddress is common use case in Java. am i missing something in etcd or Coredns config? |
[ Quoting <[email protected]> in "Re: [skynetservices/skydns] how to ..." ]
Cordns supported ANY lookup indeed! InetAddress is common use case in Java. am i missing in etcd or Coredns config?
No you're not missing something. Java is doing it wrong. Doing an ANY lookup to
find A/AAAA records is not the correct way of doing the lookup. But we can
extend the lookup mechanism to return A/AAAA in this case.
/Miek
…--
Miek Gieben
|
thanks a lot!! |
[ Quoting <[email protected]> in "Re: [skynetservices/skydns] how to ..." ]
Closed #315.
Why did you close it? You're want us to reply to ANY in CoreDNS?
/Miek
…--
Miek Gieben
|
yes,i thought it can be fix in CoreDNS,but it is a problem in skydns. |
I use skydns as my dns server.when use ping or nslookup ,all is ok.when use java:
`import java.net.InetAddress;
import java.net.UnknownHostException;
public class FindDomain {
}
get below error:
java.net.UnknownHostException: DNS service refused [response code 5]at sun.net.spi.nameservice.dns.DNSNameService.resolve(DNSNameService.java:180)
at sun.net.spi.nameservice.dns.DNSNameService.lookupAllHostAddr(DNSNameService.java:291)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
at java.net.InetAddress.getAllByName(InetAddress.java:1192)
at java.net.InetAddress.getAllByName(InetAddress.java:1126)
at java.net.InetAddress.getByName(InetAddress.java:1076)
at com.hundsun.FindDomain.getHostByIPAddress(FindDomain.java:33)
at com.hundsun.FindDomain.main(FindDomain.java:23)
`
am i missing some setting in skydns?
The text was updated successfully, but these errors were encountered: