Closed kedare closed 7 years ago
Hi @kedare,
I still can't find the cause of this issue. Per my testing the error is because there's no answer for the query "google.com" (which is weird).
A better response for not founds is handled at #8 .
However, there is some strange behaviour on the query method. Checking responses with dig
command and the same nameserver, I see several differences within the results 🤔
@odarriba : Do you have any example response?
; <<>> DiG 9.11.1-P1 <<>> @8.8.8.8 icann.org
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18324
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;icann.org. IN A
;; ANSWER SECTION:
icann.org. 350 IN A 192.0.43.7
;; Query time: 34 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Mon Jul 10 10:23:10 CEST 2017
;; MSG SIZE rcvd: 54
iex(1)> DNS.query("icann.org", {"8.8.8.8", 53})
%DNS.Record{anlist: [], arlist: [],
header: %DNS.Header{aa: false, id: 0, opcode: :query, pr: false, qr: true,
ra: true, rcode: 2, rd: false, tc: false}, nslist: [],
qdlist: [%DNS.Query{class: :in, domain: 'icann.org', type: :a}]}
We need to set the :rd
flag to true in order to allow recursive discovery 🤔
Hello,
I tried to use the library but I can't get a simple DNS.resolve to work correctly, is the README up to date ?
Here is what I get :
Using
{:dns, "~> 0.0.3"}
Thank you.