Skip to content
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

Flags loss fix #19

Closed
wants to merge 1 commit into from
Closed

Flags loss fix #19

wants to merge 1 commit into from

Conversation

RomaLash
Copy link

I want to find out is nameserver has AA flag for requested domain.

I wrote this code:
resolver = ProxyResolver(proxies=['ns1.google.com.']) res = await resolver.query('www.google.com', types.ANY, timeout=2) print("AA: ", res.aa)
But AA is 0 (incorrect).

It happend because "self.result" variable in query.py didnt get flags from "inter_res"

@gera2ld
Copy link
Owner

gera2ld commented Mar 12, 2021

If I understand the RFC correctly AA should be 0 because the proxy server is not authoritative and it returns a cached result. IMHO the other props should not be overridden by the upstream response.

It seems to be a defect that this library didn't expose a pure resolver without cache.

@RomaLash
Copy link
Author

because the proxy server is not authoritative

response from "dig"

; <<>> DiG 9.10.3-P4-Ubuntu <<>> @ns1.google.com ns www.google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41011
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available

As u can see, i used "ns1.google.com" as nameserver and get AA = 1.

oh..I see - cache mechanism doesnt save nameserver.
If I make query as above and than make another ( e.g. with 8.8.8.8 as nameserver) I still get AA = 1 (because I save it from first query for this domain).

@gera2ld
Copy link
Owner

gera2ld commented Apr 29, 2021

There is a client to get the raw response from remote server now. See readme for more detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants