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

bug!!! #1

Open
jzp820927 opened this issue Jun 21, 2016 · 5 comments
Open

bug!!! #1

jzp820927 opened this issue Jun 21, 2016 · 5 comments

Comments

@jzp820927
Copy link

netstat -lunp|egrep 63
udp 0 0 0.0.0.0:63 0.0.0.0:* 19550/dns-over-http

dig www.facebook.com -p 63
;; Warning: Message parser reports malformed message packet.

; <<>> DiG 9.10.3-P4-Ubuntu <<>> www.facebook.com -p 63
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33103
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: Message has 43 extra bytes at end

;; QUESTION SECTION:
;www.facebook.com. IN A

;; Query time: 634 msec
;; SERVER: 127.0.0.1#63(127.0.0.1)
;; WHEN: Tue Jun 21 18:45:34 CST 2016
;; MSG SIZE rcvd: 105

@wrouesnel
Copy link
Owner

Thanks for the report. This one is a little odd - by default Google gives you quite a bit of information back, which you can add to DNS replies (and I do) but dig tends not to like it. By and large, it seems to keep working as a practical resolver.

@jzp820927
Copy link
Author

jzp820927 commented Jun 21, 2016

$ nslookup

set port=63
www.google.com
Server: 127.0.0.1
Address: 127.0.0.1#63

Non-authoritative answer:
Name: www.google.com
Address: 64.233.189.105
Name: www.google.com
Address: 64.233.189.106
Name: www.google.com
Address: 64.233.189.99
Name: www.google.com
Address: 64.233.189.104
Name: www.google.com
Address: 64.233.189.147
Name: www.google.com
Address: 64.233.189.103

www.facebook.com
;; Warning: Message parser reports malformed message packet.
Server: 127.0.0.1
Address: 127.0.0.1#63

Non-authoritative answer:
*** Can't find www.facebook.com: No answer

@mattm404
Copy link

This is because it cannot handle CNAME type answers.

This hack just ignores them:

@@ -259,7 +174,10 @@ func proxy(addr string, w dns.ResponseWriter, req *dns.Msg) {
        // Parse google RRs to DNS RRs
        answers := []dns.RR{}
        for _, a := range dnsResp.Answer {
-               answers = append(answers, NewRR(a))
+               log.Debugln(a)
+               if (a.Type != 5) {
+                       answers = append(answers, NewRR(a))
+               }
        }

        // Parse google RRs to DNS RRs

@jzp820927
Copy link
Author

thx!

@jzp820927
Copy link
Author

jzp820927 commented Dec 1, 2016

nslookup www.facebook.com
Server: 127.0.0.1
Address: 127.0.0.1#53

Non-authoritative answer:
Name: star-mini.c10r.facebook.com
Address: 31.13.95.36
Name: star-mini.c10r.facebook.com
Address: 2a03:2880:f102:83:face:b00c:0:25de

ping www.facebook.com
ping: unknown host www.facebook.com

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

No branches or pull requests

3 participants