Local DNS!

*ESPHome uses a native api & most certainly not mqtt for discovery and/or communication with HA,
*ESPHome can also use mqtt if you want to, but mostly i don’t use it snce the api works wonderfully,
*ESPHome + the api usage does indeed assign a hostname to each and every single node you create,
*Every communication between HA & the ESPHome node uses this hostname, i’m guesstimating there’s thousands of lookups for those hostnames happening on my lan every day.

I repeat : mDNS is working properly.

Sorry, I thought it could be related to the inability to resolve local hostnames. One thing I’ve seen is the use of .local rather than something else, like .mylocal (which I use). It’s just something to consider. Obviously, if your local DNS resolver is somehow getting bypassed, it’s a moot point.

The following is from my router documentation, and applies to the Unbound DNS implementation used in my router. Whether it also applies to CoreDNS is not known to me.

“Do not use ‘.local’ as the final part of the domain (TLD), The ‘.local’ domain is widely used by mDNS (including Avahi and Apple OS X’s Bonjour/Rendezvous/Airprint/Airplay), and some Windows systems and networked devices. These will not network correctly if the router uses ‘.local’. Alternatives such as ‘.local.lan’ or ‘.mylocal’ are safe.”

That’s it. I’m out of ideas.

yes, .local is supposedly “reserved” for mDNS, yet OpenWRT, Pi-hole, and millions of standard Debian installations use .local as the default suffix for the hostname.
Who am I to go against the stream ?
.local just works ™ in every. single. network. i’ve ever managed.

I just followed the guidance for the router and only used the .mylocal in the setting for the router. I can ping any device on the network using either .local or .mylocal. I can’t claim this is any magic sauce, but things are working. YMMV.

I wish you a Happier™ New Year.

I’ve been trying to understand some things regarding networking and just stumbled on something useful. Its use has been discussed within the community forum, but it’s new to me. This is FYI for those who might need to look under the hood.

Aside from the CLI interface for Home Assistant (https://www.home-assistant.io/hassio/commandline/), an instance of BusyBox is included. It’s a single executable with a useful palette of utility commands.


CLI ‘busybox’ will return the list of command options. Many look like they can break the system. USE WITH CARE.

As a benign example, using the ‘hostname -f’ command reveals the fully qualified domain name: core-ssh.local.hass.io.

Please vote on this issue if you think its appropriate.



Hi! I’ve found this thread and I’ve one of the problems commented here:

  • All my local addresses are not being resolved

My router acts as DNS and it contains a name for every device on my network. Some of them added automatically, others manually by me.
Until some weeks ago the names were resolved without problem by Home Assistant, now this is not true anymore at least for some petitions, and I need to add an IP directly for that.
Others computers in the network resolve them perfectly, asking to the default DNS, my router, but seems that Home Assistant is not doing that.

Some of you, that have a similar problem, found a solution for this?



all you can do is live with it and regularly issue a ha dns restart in the HA terminal.

This solution usually worked some time ago, but since some time it does not fix the issue anymore.

If it helps… the nslookup resolves the name, but it throws an error at the end:

➜  ~ nslookup camara-pasillo.piminet

Name:   camara-pasillo.piminet
** server can't find camara-pasillo.piminet: NXDOMAIN

➜  ~ ping camara-pasillo.piminet
ping: bad address 'camara-pasillo.piminet'

As you can see, the address is finding the correct IP ( in this case), but it throws an NXDOMAIN error later that produces that this IP is discarded and not used. Maybe someone with more experience can explain that.

1 Like

I’ve found a workaround modifying the coredns template… I don’t know if this can have some drawbacks, but it seems to work and I have not found any problem until now.

In the hassio_dns docker, that contains the coredns server, there is a template file with the configuration of the coredns. I’ve modified that:

template ANY AAAA local.hass.io hassio {
        rcode NOERROR

adding my local domain (piminet) at the end:

template ANY AAAA local.hass.io hassio piminet {
        rcode NOERROR

In this way it returns NOERROR in place of NXDOMAIN and now it works and resolves the local domains without problem, at least in my case :slight_smile: .

If this solution is ok, maybe some real Home Assistant developer can add a new option to the ha dns CLI command to add the local domain here automatically.

Local network DNS is now my biggest issue.
I’m running a local network with MS AD delivered through MS DNS, clients config delivered through MS DHCP. MS DNS servers configured with just pfsense resolver as forwarder. Pfsense DNS Resolver configured with and over tls with dnssec enabled.(DNS has run well for couple of years on that config.
My IoT is running on 2 separated Vlans much like Rob’s (The Hookup). DNS for those devices delivered through PFSense resolver and client configs delivered via PFSense DHCP.
Things were working until recently but having made so many changes to get things working, I’m at the head-scratching moment…or does that come again later, feel like head has received much scratching lately.
Anyway, MS domain was running as “.home.ba.local". This has worked issue-less for 20 years.
My iot domain has been set to ".not.b
a.local.lan” as I’m told using .local is a bad idea.
I’ve configured HA to use pfsense as the primary dns but it just doesn’t resolve local devices.

I have the feeling we’re close but just need a little more granular control over configs. Not all home lans are setup with straight forward configs and while I appreciate the impossibility of trying to support all possible configs, we just need to work together to make this robust.

this, totally.
now…rest assured, using .local is not a bad idea (whatever some people ‘in-the-know’ around here are claiming).
also…dns in Home Assistant is broken since the apparition of CoreDNS, but ‘they’ (those Ivory-tower devs) are pointing fingers to ‘our’ (lowly users) bad network configurations. Problem is, there’s more & more people starting to complain.
but…personally I’ve given up the fight, and am doing a ha restart dns every so often, according to a developer this is something I’ll just have to live with. Looking at you, @pvizeli .

@balloob The community is still the greatest I’ve ever seen - for an open source project, but the top of the pyramid…ehh…not so much.
Can ya tell I’m frustrated ?

1 Like


there is more than a single thing wrong with hass.io
Remember one of the Head is from switzerland and parts of the swiss speaks german.
In German the word hass is the same as the word hate in english :wink:

  1. get rid of hass.io or whatever its called now
  2. if you didnt want to add a cronjob with something like
    docker exec -it homeassistant sh -c 'echo nameserver>/etc/resolv.conf'
    you need to run this ecerytime ha is restarted.

So vest way is to take YOUR HA setup in YOUR HANDS and smile the mistakes from these “Developer skriptkiddies” away.

HA without HASS works like a charm eg. things like tasmoadmin runs fine you just need to dig into the manuals.

1 Like

Strange. Until today I thought the word “hass” in German is a noun and therefore has to start with a capital letter :nerd_face:

And who might be ment as those “Developer skriptkiddies”? :thinking:
Me myself would not install nor use anything developed by Scriptkiddies!

Nice catch
But if your looking carfully you might notice that i own a new Notebook with another keyboardlayout and some of the chars are one key offset.
Ich hasse dich (now the Noun becomes a adjektive)
TbH i really dont know if i called one of the “two” guys a scriptkiddie because everything worse i noticed was from only one of them.
eg. the Pulse Audio BS. AFAIK THAT must be the Swiss Guy.

this whole hass.io - hassio debacle is totally off-topic, and also it is no longer current.
Changing the Home Assistant Brand - Home Assistant (home-assistant.io)
Hassio no longer exists.

I strongly disagree with branding the devs as scriptkiddies. The software they are building clearly demonstrates they are in no way scriptkiddies. I would brand some of them as ‘haughty & detached from the userbase.’

I migrated from a Supervised install to Home Assistant OS for simplicity & easy of management. Little did I know that DNS in HA-OS is broken & classed as wont-fix-stop-complaining by the dev in charge.
DNS being the only major gripe I have, I’ll stick with ha dns restart untill it gets fixed, or untill it gets broken even more.

1 Like

What did you end up doing as I am at this point myself. Was running venv, decided it was time to switch to haos and 3 days in and i’m almost done with it due to DNS alone. Everything else is great but DNS is making it unusable.

Can you point me in the direction of how you made those changes and where the files are. It’s easy to get shell in hassio but it’s quite a bit different layout from my venv environment.

I gave up, @pvizeli doesn’t care about broken DNS according to his words in the github bug report. And others from the dev team, such as @balloob can’t be bothered to even chime in.
I’m just doing a ha dns restart in the shell, every day or so.