ogham / dog

A command-line DNS client.
https://dns.lookup.dog/
European Union Public License 1.2
6.08k stars 170 forks source link

Error [network]: No such host is known. (os error 11001) #9

Open andrejohansson opened 3 years ago

andrejohansson commented 3 years ago

Can´t seem to get this to work, am I missing something obvious?

Dog

❯ dog google.com
Error [network]: No such host is known. (os error 11001)

Dig

❯ dig google.com

; <<>> DiG 9.14.8 <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46221
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             240     IN      A       172.217.21.174

;; Query time: 0 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Mon Nov 09 16:25:04 W. Europe Standard Time 2020
;; MSG SIZE  rcvd: 55

Version information

❯ dog --version
dog ● command-line DNS client
v0.1.0
https://dns.lookup.dog/
Edition Windows 10 Pro for Workstations
Version 20H2
Installed on    ‎2020-‎06-‎17
OS build    19042.610
Experience  Windows Feature Experience Pack 120.2212.31.0
ogham commented 3 years ago

Well, if you're using software that's on version zero point one, it's probably the software, not you :)

Could you re-run your query with the DOG_DEBUG environment variable set to a non-empty string? This is looking similar to issue #2.

orawalters commented 3 years ago

Seems it has trouble getting a default nameserver. A workaround of dog google.com -n 1.1.1.1 solved the issue for me.

SerialSmile commented 3 years ago

@ogham This bug occurs because of this LOC. First adapter not always what we need. In my case it was Hyper-V adaper.

andrejohansson commented 3 years ago

I can confirm that dog google.com -n 1.1.1.1 helped for me too, and I have a lot of adapters so what @SerialSmile concludes is very likely.

Kirill commented 3 years ago

Windows 10 Pro. same problem.

BYK commented 3 years ago

This seems to be resolved by 8238e217c74485e84b204b3819445bc8b44da732 on master. I can verify it is fixed now.

Kirill commented 3 years ago

When it's come to release?

ogham commented 3 years ago

In the next release I want to include some way to set the adapter.

Thanks for the reports, all

LelouBil commented 2 years ago

How's v0.2.0 coming along now ?

I just installed it using scoop and I encountered this exact error

Elypha commented 2 years ago

Hi, I tried to build from the current master branch and found that the issue does not seem to be solved.

Please see the following logs.

working with -n ```powershell ./dog google.com -n 1.1.1.1 [INFO dog] Running with options -> Options { requests: RequestGenerator { inputs: Inputs { domains: [ Labels { segments: [ ( 6, "google", ), ( 3, "com", ), ], }, ], record_types: [ A, ], classes: [ IN, ], resolver_types: [ Specific( "1.1.1.1", ), ], transport_types: [ Automatic, ], }, txid_generator: Random, edns: SendAndHide, protocol_tweaks: ProtocolTweaks { set_authoritative_flag: false, set_authentic_flag: false, set_checking_disabled_flag: false, udp_payload_size: None, }, }, measure_time: false, format: Text( Automatic, TextFormat { format_durations: true, }, ), } [DEBUG dog::hints] Reading hints from /etc/hosts equivalent [INFO dns_transport::udp] Opening UDP socket [DEBUG dns_transport::udp] Opened [INFO dns_transport::udp] Sending 39 bytes of data to 1.1.1.1 over UDP [DEBUG dns_transport::udp] Wrote 39 bytes [INFO dns_transport::udp] Waiting to receive... [INFO dns_transport::udp] Received 55 bytes of data [INFO dns::wire] Parsing response [DEBUG dns::wire] Reading 1x query from response [DEBUG dns::wire] Reading 1x answer from response [INFO dns::wire] Parsing A record (type 1, len 4) [DEBUG dns::wire] Reading 0x authority from response [DEBUG dns::wire] Reading 1x additional answer from response A google.com. 4m43s 142.250.179.238 ```
failed with defaults ```powershell ./dog google.com [INFO dog] Running with options -> Options { requests: RequestGenerator { inputs: Inputs { domains: [ Labels { segments: [ ( 6, "google", ), ( 3, "com", ), ], }, ], record_types: [ A, ], classes: [ IN, ], resolver_types: [ SystemDefault, ], transport_types: [ Automatic, ], }, txid_generator: Random, edns: SendAndHide, protocol_tweaks: ProtocolTweaks { set_authoritative_flag: false, set_authentic_flag: false, set_checking_disabled_flag: false, udp_payload_size: None, }, }, measure_time: false, format: Text( Automatic, TextFormat { format_durations: true, }, ), } [DEBUG dog::hints] Reading hints from /etc/hosts equivalent [DEBUG dog::resolve] Found first nameserver 2606:4700:4700::1111 [INFO dns_transport::udp] Opening UDP socket Error [network]: No such host is known. (os error 11001) ```
OS Name:                   Microsoft Windows 11 Pro
OS Version:                10.0.22000 N/A Build 22000
System Type:               x64-based PC
ocitrev commented 1 year ago

I was hitting this issue after installing Tailscale which creates a new adapter in Windows. I was able to mitigate the issue by setting the InterfaceMetric to a higher value (I changed the metric from 5 to 100).

I used this PowerShell command (interface index 11 is the Tailscale interface)

Set-NetIPInterface -InterfaceIndex 11 -InterfaceMetric 100
l33tlamer commented 2 months ago

Well, if you're using software that's on version zero point one, it's probably the software, not you :)

4 years later, its the same version and the same problem tho... cough