home-assistant / plugin-dns

CoreDNS implementation for Home Assistant
Apache License 2.0
20 stars 14 forks source link

Logs->DNS - bunch of "tls: DialWithDialer timed out" #94

Open Masterz69 opened 2 years ago

Masterz69 commented 2 years ago

The problem

No sure if it related to HA Core or HA OS, but logs seen in HA GUI, so - let's start from HA Core issue tracker. As recently announced new log viewing page in HA, discovered those records:


[INFO] 127.0.0.1:41679 - 655 "A IN eu-pconnect1.coolkit.cc. udp 52 true 2048" NOERROR - 0 5.00423423s
[ERROR] plugin/errors: 2 eu-pconnect1.coolkit.cc. A: tls: DialWithDialer timed out
[INFO] 127.0.0.1:37911 - 1229 "AAAA IN eu-pconnect1.coolkit.cc. udp 52 true 2048" NOERROR - 0 5.008074493s
[ERROR] plugin/errors: 2 eu-pconnect1.coolkit.cc. AAAA: tls: DialWithDialer timed out
[INFO] 172.30.32.1:53517 - 1229 "AAAA IN eu-pconnect1.coolkit.cc. udp 41 false 512" NOERROR - 0 8.003538787s
[ERROR] plugin/errors: 2 eu-pconnect1.coolkit.cc. AAAA: read udp 127.0.0.1:52011->127.0.0.1:5553: i/o timeout
[INFO] 172.30.32.1:53517 - 655 "A IN eu-pconnect1.coolkit.cc. udp 41 false 512" NOERROR - 0 8.004318628s
[ERROR] plugin/errors: 2 eu-pconnect1.coolkit.cc. A: read udp 127.0.0.1:48054->127.0.0.1:5553: i/o timeout
[INFO] 127.0.0.1:57770 - 2645 "A IN version.home-assistant.io. udp 54 true 2048" NOERROR - 0 5.004183879s
[ERROR] plugin/errors: 2 version.home-assistant.io. A: tls: DialWithDialer timed out
[INFO] 172.30.32.2:57701 - 2645 "A IN version.home-assistant.io. udp 43 false 512" NOERROR - 0 8.003830839s
[ERROR] plugin/errors: 2 version.home-assistant.io. A: read udp 127.0.0.1:47046->127.0.0.1:5553: i/o timeout
[INFO] 127.0.0.1:47885 - 2645 "A IN version.home-assistant.io. udp 54 true 2048" NOERROR - 0 5.002667627s
[ERROR] plugin/errors: 2 version.home-assistant.io. A: dial tcp 1.1.1.1:853: i/o timeout
[INFO] 127.0.0.1:36046 - 2645 "A IN version.home-assistant.io. udp 54 true 2048" NOERROR - 0 5.003291991s
[ERROR] plugin/errors: 2 version.home-assistant.io. A: tls: DialWithDialer timed out
[INFO] 172.30.32.2:57701 - 2645 "A IN version.home-assistant.io. udp 43 false 512" NOERROR - 0 8.004757783s
[ERROR] plugin/errors: 2 version.home-assistant.io. A: read udp 127.0.0.1:40797->127.0.0.1:5553: i/o timeout
[INFO] 127.0.0.1:47046 - 2645 "A IN version.home-assistant.io. udp 54 true 2048" NOERROR - 0 5.004347925s
[ERROR] plugin/errors: 2 version.home-assistant.io. A: tls: DialWithDialer timed out
[INFO] 127.0.0.1:51360 - 2645 "A IN version.home-assistant.io. udp 54 true 2048" NOERROR - 0 5.003105685s
[ERROR] plugin/errors: 2 version.home-assistant.io. A: tls: DialWithDialer timed out
[INFO] 127.0.0.1:40797 - 2645 "A IN version.home-assistant.io. udp 54 true 2048" NOERROR - 0 5.002842286s
[ERROR] plugin/errors: 2 version.home-assistant.io. A: tls: DialWithDialer timed out
[INFO] 127.0.0.1:45794 - 18073 "A IN version.home-assistant.io. udp 54 true 2048" NOERROR - 0 5.004073857s
[ERROR] plugin/errors: 2 version.home-assistant.io. A: tls: DialWithDialer timed out
[INFO] 172.30.32.2:55439 - 18073 "A IN version.home-assistant.io. udp 43 false 512" NOERROR - 0 8.006916041s
[ERROR] plugin/errors: 2 version.home-assistant.io. A: read udp 127.0.0.1:50641->127.0.0.1:5553: i/o timeout
[INFO] 127.0.0.1:34451 - 18073 "A IN version.home-assistant.io. udp 54 true 2048" NOERROR - 0 5.003637647s
[ERROR] plugin/errors: 2 version.home-assistant.io. A: dial tcp 1.0.0.1:853: i/o timeout
[INFO] 172.30.32.2:55439 - 18073 "A IN version.home-assistant.io. udp 43 false 512" NOERROR - 0 8.014196954s
[ERROR] plugin/errors: 2 version.home-assistant.io. A: read udp 127.0.0.1:52492->127.0.0.1:5553: i/o timeout
[INFO] 127.0.0.1:33445 - 18073 "A IN version.home-assistant.io. udp 54 true 2048" NOERROR - 0 5.0042627s
[ERROR] plugin/errors: 2 version.home-assistant.io. A: tls: DialWithDialer timed out
[INFO] 127.0.0.1:50641 - 18073 "A IN version.home-assistant.io. udp 54 true 2048" NOERROR - 0 6.0040143s
[ERROR] plugin/errors: 2 version.home-assistant.io. A: tls: DialWithDialer timed out```

### What version of Home Assistant Core has the issue?

core-2022.5.4

### What was the last working version of Home Assistant Core?

_No response_

### What type of installation are you running?

Home Assistant OS

### Integration causing the issue

_No response_

### Link to integration documentation on our website

_No response_

### Diagnostics information

_No response_

### Example YAML snippet

_No response_

### Anything in the logs that might be useful for us?

_No response_

### Additional information

Home Assistant Core 2022.5.4
Home Assistant Supervisor 2022.05.1
Home Assistant OS 7.4
Kernel version 5.10.92-v8
Agent version 1.2.1

Using DNSmasq 1.4.4 as DNS server for LAN clients and HA (configured on eth0).
mdegat01 commented 2 years ago

Do you block cloudflare's DNS server on your network? Because that is what HA uses as a fallback DNS server and it looks like the timeouts are coming from the fallback.

If you block cloudflare's DNS server on your network then you should disable the fallback DNS with this command:

ha dns options --fallback=false

Otherwise you will see a lot of errors in your logs.

That being said you might actually want to consider unblocking Cloudflare's DNS server and leaving the fallback enabled because your DNS server seems to have some issues. This line in particular is problematic:

[INFO] 127.0.0.1:47885 - 2645 "A IN version.home-assistant.io. udp 54 true 2048" NOERROR - 0 5.002667627s
[ERROR] plugin/errors: 2 version.home-assistant.io. A: dial tcp 1.1.1.1:853: i/o timeout

version.home-assistant.io definitely exists and being able to access it is rather critical to successful operation of HA, you won't get any updates otherwise. If you're blocking it in your DNS server you should not do that or you will definitely see a lot of errors no matter what you do here. If you aren't blocking it then you should either figure out why your DNS server is unable to resolve that domain or unblock the fallback DNS and let cloudflare do it.

Masterz69 commented 2 years ago

Do you block cloudflare's DNS server on your network?

As far as I know - no.

HA use DNS add-on (running on same HA), then ISP provided LTE router, that's all. Nowhere configured any blocks or smth like this. Will check Your suggestion.

mdegat01 commented 2 years ago

Interesting. Yea sorry I jumped to conclusion, people blocking cloudflare at the router is the usual culprit for errors that look like that. If not there might be a network issue? Are you able to get to version.home-assistant.io elsewhere on your network? If so perhaps if you run ha network info and ha resolution info on HA will show something that could give some insight here?

Masterz69 commented 2 years ago

From another host in my network. Same I getting on my laptop through corporate VPN (just different HostId).

404 Not Found
Code: NoSuchKey
Message: The specified key does not exist.
Key: index.html
RequestId: 018THZASR98WARRJ
HostId: +eK0Nz7lAkatAvDIXI8dP+QjXr8lQH+SjKTVxJRBhfAxPIEeRmG2N2+g99BLGSAz3S+5cdvxFuA=

image

| |  | |                          /\           (_)   | |            | |
| |__| | ___  _ __ ___   ___     /  \   ___ ___ _ ___| |_ __ _ _ __ | |_
|  __  |/ _ \| '_ \ _ \ / _ \   / /\ \ / __/ __| / __| __/ _\ | '_ \| __|
| |  | | (_) | | | | | |  __/  / ____ \\__ \__ \ \__ \ || (_| | | | | |_
|_|  |_|\___/|_| |_| |_|\___| /_/    \_\___/___/_|___/\__\__,_|_| |_|\__|

Welcome to the Home Assistant command line.

System information
  IPv4 addresses for eth0:  192.168.1.11/24
  IPv4 addresses for wlan0:

  OS Version:               Home Assistant OS 7.4
  Home Assistant Core:      2022.5.4

  Home Assistant URL:       http://ha.local:8123
  Observer URL:             http://ha.local:4357
➜  ~ ha network info
docker:
  address: 172.30.32.0/23
  dns: 172.30.32.3
  gateway: 172.30.32.1
  interface: hassio
host_internet: true
interfaces:
- connected: true
  enabled: true
  interface: eth0
  ipv4:
    address:
    - 192.168.1.11/24
    gateway: 192.168.1.1
    method: static
    nameservers:
    - 192.168.1.11
  ipv6:
    address: []
    gateway: null
    method: disabled
    nameservers: []
  primary: true
  type: ethernet
  vlan: null
  wifi: null
- connected: false
  enabled: false
  interface: wlan0
  ipv4:
    address: []
    gateway: null
    method: disabled
    nameservers: []
  ipv6:
    address: []
    gateway: null
    method: disabled
    nameservers: []
  primary: false
  type: wireless
  vlan: null
  wifi: null
supervisor_internet: true
➜  ~ ha resolution info
checks:
- enabled: true
  slug: addon_pwned
- enabled: true
  slug: dns_server_ipv6_error
- enabled: true
  slug: free_space
- enabled: true
  slug: supervisor_trust
- enabled: true
  slug: dns_server_failure
- enabled: true
  slug: core_security
issues:
- context: dns_server
  reference: dns://192.168.1.11
  type: dns_server_ipv6_error
  uuid: cb7ad87af3f04b7c9145e5de949f71d9
- context: dns_server
  reference: dns://192.168.1.11
  type: dns_server_failed
  uuid: 8e05b9435f224263a80045b87f5fdc91
suggestions: []
unhealthy: []
unsupported: []
➜  ~ wget https://version.home-assistant.io/
--2022-05-20 20:43:29--  https://version.home-assistant.io/
Resolving version.home-assistant.io (version.home-assistant.io)... 172.67.68.90, 104.26.4.238, 104.26.5.238, ...
Connecting to version.home-assistant.io (version.home-assistant.io)|172.67.68.90|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2022-05-20 20:43:31 ERROR 404: Not Found.
➜  ~

System Health

version core-2022.5.4
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.9
os_name Linux
os_version 5.10.92-v8
arch aarch64
timezone Europe/Riga
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4735 Installed Version | 1.24.5 Stage | running Available Repositories | 1124 Downloaded Repositories | 41
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 7.4 -- | -- update_channel | stable supervisor_version | supervisor-2022.05.2 docker_version | 20.10.9 disk_total | 57.8 GB disk_used | 27.5 GB healthy | true supported | true board | rpi4-64 supervisor_api | ok version_api | ok installed_addons | Samba Backup (5.0.0), SSH & Web Terminal (10.1.3), File editor (5.3.3), Mosquitto broker (6.1.2), Z-Wave JS to MQTT (0.39.0), Zigbee2mqtt (1.25.1-1), MariaDB (2.4.0), phpMyAdmin (0.7.1), Samba share (9.6.1), DHCP server (1.3.0), Dnsmasq (1.4.4)
Dashboards dashboards | 9 -- | -- resources | 24 views | 32 mode | storage
Sonoff version | 3.0.5 (200f243) -- | -- cloud_online | 6 / 12 local_online | 5 / 5 debug | failed to load:
Xiaomi Gateway 3 version | 2.1.0 (3d126a5) -- | --
mdegat01 commented 2 years ago

@Masterz69 Oh sorry I had just meant to see if dns could resolve for version.home-assistant.io. Like doing dig version.home-assistant.io from another machine. If you go to version.home-assistant.io then yea you do see a 404 like that, if you want to test this in a browser then you would go to https://version.home-assistant.io/stable.json (that's what HA actually pulls from that site).

But in terms of HA your biggest problem is this:

Screen Shot 2022-05-22 at 11 51 38 AM

That's HA basically telling you that DNS isn't working at all. So I would start there.

One thing I notice by your network config is that you are trying to use HA itself as the DNS server. I'm guessing you're running the adguard addon or something right? Have you gotten this working before or are you just trying to set it up for the first time? If you are just setting this up are you able to successfully get DNS answers from that addon from other machines on your network?

Masterz69 commented 2 years ago

I'm guessing you're running the adguard addon or something right?

Official add-on Dnsmasq. image

All other devices in my network using it and have no problems, as far I see.

From HA host:

➜  ~ dig version.home-assistant.io

; <<>> DiG 9.16.27 <<>> version.home-assistant.io
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40224
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 7b5213c2b13fda84 (echoed)
;; QUESTION SECTION:
;version.home-assistant.io.     IN      A

;; ANSWER SECTION:
version.home-assistant.io. 193  IN      A       104.26.4.238
version.home-assistant.io. 193  IN      A       104.26.5.238
version.home-assistant.io. 193  IN      A       172.67.68.90

;; Query time: 3 msec
;; SERVER: 172.30.32.3#53(172.30.32.3)
;; WHEN: Sun May 22 19:00:28 EEST 2022
;; MSG SIZE  rcvd: 189

From Windows host:

C:\Users\IgMi>nslookup version.home-assistant.io
Server:  UnKnown
Address:  192.168.1.11

Non-authoritative answer:
Name:    version.home-assistant.io
Addresses:  2606:4700:20::681a:5ee
          2606:4700:20::ac43:445a
          2606:4700:20::681a:4ee
          104.26.5.238
          104.26.4.238
          172.67.68.90