Open smithice opened 7 years ago
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:
Standard query 0x9443 ANY test.mydnsserver.com Standard query response 0x9443 Refused ANY test.mydnsserver.com
it seems like the issue (https://github.com/skynetservices/skydns/issues/97)
JAVA InetAddress seem use 'ANY' query...
ANY
!!!???1!? Why?
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 A
records when doing an ANY lookup, meaning the above code may work.
Can this ANY
behavior be disabled in Java?
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
(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 }
[ Quoting notifications@github.com 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. am i missing something? here is dig ANY,and A query dig ANY @192.168.48.223 test.mydomain.com ` ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.62.rc1.el6 <<>> ANY @192.168.48.223 test.mydomain.com ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36889 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION: ;test.mydomain.com. IN ANY
;; AUTHORITY SECTION: mydomain.com. 5 IN SOA ns.dns.mydomain.com. hostmaster.mydomain.com. 1492736874 7200 1800 86400 60
;; Query time: 5 msec ;; SERVER: 192.168.48.223#53(192.168.48.223) ;; WHEN: Fri Apr 21 09:10:16 2017 ;; MSG SIZE rcvd: 88 `
` dig A @192.168.48.223 test.mydomain.com
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.62.rc1.el6 <<>> A @192.168.48.223 test.mydomain.com ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27650 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION: ;test.mydomain.com. IN A
;; ANSWER SECTION: test.mydomain.com. 5 IN A 192.168.48.106
;; Query time: 2 msec ;; SERVER: 192.168.48.223#53(192.168.48.223) ;; WHEN: Fri Apr 21 09:12:12 2017 ;; MSG SIZE rcvd: 50 `
Cordns supported ANY lookup indeed! InetAddress is common use case in Java. am i missing something in etcd or Coredns config?
[ Quoting notifications@github.com 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 notifications@github.com 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?