Is there any way to create a hostname alias?

I have a few static leases going on in my home network.

For instance, homeassistant.lan points to 192.168.1.217

I'd like to create an 'alias' for this hostname, so that I can go to ha.lan too.

Right now, I'm running a hostname (Network > DHCP an DNS > Hostnames) pointing ha to 192.168.1.217 but that's really not ideal as this will stop working if Home Assistant's IP ever changes.

I am aware that I can set up a static IP for Home Assistant as a workaround, but I'd like to keep everything as dynamic as possible.

Is there some way in which I can get this done?

My opinion is that setting a static lease for the machine is not a workaround, it's the proper solution. Servers like this almost always have static/pseudo-static IPs in the real world, and using router-based reservations are nice because they centralize all control right there on the router, no messing with network config on all the various machines...

1 Like

There is such an option since version 23.05.

1 Like

That's beautiful! Thank you.

1 Like

Good point.

There is a problem having servers on static hostname and dynamic IP.

If the router reboot or loose power but the server have its power then you can end up in a situation where you need to wait the leasetime before the server ask for a new address and then gets its hostname before you can use the hostname to connect to the server.

So as already mentioned, it is better to use static IP leases for servers instead of relying on hostnames.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.