How do I get HA hostname to work? IP works fine

Hi folks.
I’m struggling to get my Home Assistant server’s hostname “HAS” to work. Any ideas please? My knowledge of network setup is limited. So far:

In June I bought an Odroid M1 with HA pre-loaded, but not initialised. On first power-up, I followed through the install procedure, setting its Name to HAS, and etc… Ok.
From then on I’ve only ever been able to access it using its IP address, not via a hostname (HAS) or homeassistant.local. HAS is LAN cabled directly to my router and on a fixed IP address.
I can access and ping my other local network devices by their hostnames ok. But not HAS.

Trying to sort this, and following ideas from related Forum topics, I’ve

  • Gone into Settings / System / General and checked the system Name is ‘HAS’ as intended.
  • Gone into Settings / System / Network and set Host Name to HAS and saved.
  • And then rebooted, just to be sure.
    Still from my Windows laptop I can ping the IP address ok, but hostname HAS, HAS.local and homeassistant.local all result in “Ping request could not find host [whichever used].”
    Pings to other device hostnames work fine.

I have Updated my HA system several times and am now on Home Assistant 2023.8.1 Supervisor 2023.07.1 Operating System 10.4 Frontend 20230802.0 - latest.
Plus Add-ons Z-Wave JS version: 0.1.85, Studio Code Server version: 5.10.0.

My router has VLANs with HAS on one (not Main or default). Main VLAN has access to all other VLANs, but Inter-VLAN routing is otherwise blocked. I ran the above checks from my laptop on the Main LAN.

Any ideas/suggestions will be much appreciated… Thanks all.

Incidentally, I’m finding the Odroid M1 8GB + SSD solution very good. Much better than when I had HA on Docker on my NAS. And now it’s a supported platform too! Great.

Add your Homeassistant Server with its name and IP into your local DNS? That usually does not happen automatically. And using a fixed IP your Home Assistant Server does not announce itself to the router like it does with DHCP. mDNS also does not work very well with multiple VLAN as far as I know.

You didn’t provide information about your router, but a router capable configuring VLANs might have a builtin DNS for multiple zones too.

Armin

Which URL specifically? This one?

http://homeassistant.local:8123

If so, you need to make sure mDNS is enabled across the VLANs.

Hi Ryan.
No - I’m trying to get hostname “HAS” to map to its server’s local IP 192.168.xxx.yyy, which is on one of my VLANs.
But even originally, http://homeassistant.local:8123 did not work. I had to use the IP address+port to get access - and still do.

I’d expect that the action “Settings / System / Network and set Host Name to HAS and save” ought to set this mapping up - else what’s the point of this Network web form? So, is it “not working” a bug?
Does using this HA network setting normally setup the hostname mapping correctly?

Hostnames work ok on all my other devices (NAS, router, etc.) and is pretty standard stuff, so why is it not working on HA core?

add domain .local to your vlan settings “homeassistant” is a host-name ".local " is it’s domain-name

Have you done a full reboot since changing the hostname? A quick test says a full HAOS reboot is required to get the hostname to fully update. Once that is done, then HA should be listening for “http://has.local:8123” in your case.

By default, nothing is “registered” per se. HA (and a lot of other products) use multicast DNS to basically “listen” for a specific hostname. These are the *.local names you see floating around and do not map to a particular IP address. Essentially, the router/switch forwards these address calls out to all nodes and the right one will respond. This requires mDNS to be enabled on the local VLAN and, if the host and HA are in different VLANS, requires the mDNS reflector service on the router. That handles passing mDNS packets between VLANs. These don’t require a DNS server.

A true DNS registration binds an IP address to a hostname and this requires a DNS server. Some basic routers do have local DNS where they will automagically create an entry for a host when it comes up, but I’d consider this flaky at best.

If you want actual name resolution, you’ll need a dns server. Dnsmasq is a good add on one.

Many thanks all, and especially to Ryan (FriedCheese).
I’m using Unifi UDMP and had mDNS defaulted on, but it was off on my main LAN where my laptop is running, so no Ping responses. Turned that on and all now ok for hostname “HAS”, not on Main LAN.
UDMP won’t let me set up a simple hostname mapping to it’s IP - it insists on a FQDN and also rejects a HAS.local entry as reserved for mDNS (understandable).

Thanks again all.

1 Like