Access Turris 1.x by the hostname

Hi community,
I have Turris1.1 (migrated to btrfs and latest firmware) and I enabled DHCP clients in DNS option in foris. This works well out of the box. I can access all my dhcp clients with the format of hostname.lan.
But I’d like to access also Turris itself with the hostname and I can’t seem to figure out to correct setup for that. As of now I can access turris just with its IP address.
Any help will be appreciated.
Thanks.
Petr

1 Like

Add a record to LuCI / Network / Hostnames.

1 Like

gateway or gateway.lan used to work but this is no longer the case (without adding any record).

Thanks for your help @pav. I added new entry into the LuCi / Network / Hostnames like this: router → 192.168.1.1. Then I restarted Turris but still router name is not resolved:

$ getent hosts router
$

but if I use IP address directly it shows this:

$ getent hosts 192.168.1.1
192.168.1.1 router.lan

With other client computers in LAN it works just well:

$ getent hosts obyvak
192.168.1.174 obyvak.lan

Any thoughts?

Thanks @X-dark. It does not work for me either.

you need to ask for router.lan instead of router. Direct names do not work by default.

gateway is name added on client side by systemd-resolved (if you use it). I’m not aware of Turris doing that on router. systemd-resolved.service

Yes it may be true. I do not recall if I ever used it on non-Linux machines.

Does not work either:

$ getent hosts router.lan
$

Right, probably a red herring. I assume that LuCi / Network / Hostnames only affects dnsmasq DNS, and that isn’t used by default in Turris. (But I can’t confirm the first statement quickly.)

Looking around in the /etc/config folder of my Turris. I found following section in the /etc/config/dhcp

config domain
option name ‘router’
option ip ‘192.168.1.1’

Should this have desired effect on configuration?

/etc/config/dhcp is for dnsmasq, and dnsmasq isn’t used for DNS by default.

I have configured unbound to forward local queries/local PTR via dnsmasq (which serves DHCP also) as described HERE - czech only, calling router via its name works fine also, but not sure if this is “supported scenerio” :=0