natesales / q

A tiny command line DNS client with support for UDP, TCP, DoT, DoH, DoQ and ODoH.
GNU General Public License v3.0
1.76k stars 62 forks source link

`q` has issue querying domain with hyphen in them #55

Closed chitao1234 closed 1 year ago

chitao1234 commented 1 year ago

I'm using version https://github.com/natesales/q version 0.11.3.6f19164 (6f19164524488261246060c7bc4f5e304441729c 2023-07-09) on Linux CHI-Endeavouros 6.4.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 06 Jul 2023 18:35:54 +0000 x86_64 GNU/Linux, the same problem could be reproduced on 0.11.3 When querying domain like www.m-w.com, q would query root server instead.

Output:

./q www.m-w.com -v
DEBU[0000] Name:                                        
DEBU[0000] RR types: [NS]                               
DEBU[0000] No server specified or Q_DEFAULT_SERVER set, using /etc/resolv.conf 
DEBU[0000] found server 192.168.1.1 from /etc/resolv.conf 
DEBU[0000] Using UDP with TCP fallback                  
FATA[0000] dns: short read           
natesales commented 1 year ago

Thanks for the report - this was a fun little edge case. I've just released v0.11.4 with a fix!