home-assistant / plugin-dns

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

Local network addresses not resolved #103

Open ktuulos opened 1 year ago

ktuulos commented 1 year ago

My previous HA crashed and I had to re-install from 28-Feb-2023 version of haos_ova-9.5.vdi.zip.

My local network has plenty of dynamic IPs and they are handled well by router. For example, I am (and in previous HA installation I was) able to point to "shelly1-03.local", which resolves to this Shelly's IP address. Anyway, in this new HA installation, resolving of local addresses don't work any more.

I have tried to manually add my router's IP to DNS, but no help. Here are some experiments to show the situation.

[core-ssh ~]$ ping shelly1-03.local
ping: bad address 'shelly1-03.local'
[core-ssh ~]$ ping shelly1-03
ping: bad address 'shelly1-03'
[core-ssh ~]$ nslookup shelly1-03.local
Server:     127.0.0.11
Address:    127.0.0.11#53

*** Can't find shelly1-03.local: No answer

[core-ssh ~]$ nslookup shelly1-03.local 192.168.1.1
Server:     192.168.1.1
Address:    192.168.1.1#53

Name:   shelly1-03.local
Address: 192.168.20.33

[core-ssh ~]$ ha dns info
fallback: true
host: 172.30.32.3
llmnr: true
locals:
- dns://192.168.1.1
mdns: true
servers:
- dns://192.168.1.1
update_available: false
version: 2022.04.1
version_latest: 2022.04.1

Here is system information.

[core-ssh ~]$ ha core info
arch: amd64
audio_input: null
audio_output: null
boot: true
image: ghcr.io/home-assistant/qemux86-64-homeassistant
ip_address: 172.30.32.1
machine: qemux86-64
port: 8123
ssl: true
update_available: false
version: 2023.2.5
version_latest: 2023.2.5
watchdog: true
[core-ssh ~]$ ha os info
board: ova
boot: A
data_disk: /dev/sda8
update_available: false
version: "9.5"
version_latest: "9.5"
[core-ssh ~]$ ha cli info
update_available: false
version: 2022.11.0
version_latest: 2022.11.0
[core-ssh ~]$ 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: enp0s3
  ipv4:
    address:
    - 192.168.1.4/23
    gateway: 192.168.1.1
    method: static
    nameservers:
    - 192.168.1.1
    ready: true
  ipv6:
    address:
    - 2001:scrubbed:48b7/64
    - fe80::4d2b:a96f:e0c0:b84a/64
    gateway: fe80::c66e:1fff:feaa:4d36
    method: auto
    nameservers: []
    ready: true
  primary: true
  type: ethernet
  vlan: null
  wifi: null
supervisor_internet: true
WhimsySpoon commented 1 year ago

I have the same issue, but it was since upgrading HA OS to 10.0 (10.1 is also affected).

Local DNS resolution works fine for a number of hours, but then stops. I can conduct a successful local DNS lookup using nslookup if I specify an internal DNS server, but an nslookup without a server specified uses 127.0.0.11 and can resolve external addresses only.

My DNS options have always been set to use my internal DNS servers.

WhimsySpoon commented 1 year ago

I've just performed a HA OS reboot and I can resolve local DNS addresses again. nslookup is still using 127.0.0.11 for its server, but it is working. I expect it will stop again in a few hours.