Can hosts be referred to by name?

I noticed connectivity problems when I use host names (FQDN) instead of IPs in my configurations (in places where they are needed - in my case for a Chromecast or a Harmony Hub). The problems are gone if I use IPs.

Before investigating further I wanted to make sure that it is at all possible to use device names (FQDN) instead of IPs?

Note: DNS resolution on the host where HA runs works fine.

Sure, if you have a reliable DNS server on your network and your HA is pointing to that DNS server.

I use host names as default over ip addresses. It’s not an issue as long as your router and/or DNS server is up to the task.

@flamingm0e @Dixey Thanks. This is what I was expecting and therefore what worries me.

DNS works fine (dig somehost.example.com), connectivity as well (typical stuff such as ping with the names, and only IPs in HA) .

I will investigate, thanks.

Are you using an actual DNS server or trying to rely on Avahi/mDNS/bonjour?

I am using an actual DNS server.

When retrying I realized that the problem is only with ChromeCast.

I erroneously extended it to Harmony (both were initially defined via their FQDN), so

  • I tried IP with both (works OK),
  • then reverted to FQDN for Harmony (works OK),
  • then reverted to FQDN for ChromeCast (this one is KO)

In the last case ChromeCast is not set up (says that it will retry in 30, 60, … seconds) while with an IP it takes 0.0 s.

Pihole does a great job of dns and DHCP.

I use dnsmasq which manages several containers and my Wi-Fi. It works great and allows for quite complicated setups.

Pihole uses (and leverages) dnsmasq.