esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 36 forks source link

DNS settings incorrect / overwritten when container restarts - breaks OTA #5990

Open andreas-bulling opened 4 months ago

andreas-bulling commented 4 months ago

The problem

I have had issues with ESPHome for quite some time. Namely that OTA didn't work because .local device hostnames couldn't be found/resolved. Some devices worked for some reason, most didn't.

It took me a long time until I figured out what was going on:

exec -it addon_5c53de3b_esphome bash in the Advanced SSH & Web Terminal and cat /etc/resolv.conf showed an automatically generated file with a completely wrong nameserver (no idea where this is coming from and which IP is used here):

# Generated by Docker Engine.
# This file can be edited; Docker Engine will not make further changes once it
# has been modified.

nameserver 172.30.32.3
search local.hass.io
options timeout:10

# Based on host file: '/etc/resolv.conf'
# Overrides: [nameservers search options]

I can edit the file and fix the nameserver / search entry. But after a restart the container is restarted and the file is reset.

Result: I have to manually fix resolv.conf manually every couple of days.

I am pretty certain that this was not necessary last year, i.e. with an older version of ESPHome/HA

Which version of ESPHome has the issue?

2024.6.4

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

No response

What platform are you using?

ESP32

Board

No response

Component causing the issue

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

gabest11 commented 4 months ago

This is more like a docker issue. Try it in host mode or specify your dns settings. https://docs.docker.com/compose/compose-file/05-services/#dns

andreas-bulling commented 4 months ago

I have no idea how/where to configure host mode/dns settings. afaik the containers are all managed/started by HA...

github-actions[bot] commented 3 days ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.