# Simple host names - hostfile?

**URL:** <https://forum.openwrt.org/t/simple-host-names-hostfile/255459>\
**Category:** Network and Wireless Configuration\
**Created:** [November 13, 2026, 7:16pm UTC](https://forum.openwrt.org/t/simple-host-names-hostfile/255459 "2026-11-13T19:16:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![udippel](https://forum.openwrt.org/user_avatar/forum.openwrt.org/udippel/32/131036_2.png) [@udippel](https://forum.openwrt.org/u/udippel)\
**Post date:** [November 13, 2026, 7:16pm UTC](https://forum.openwrt.org/t/simple-host-names-hostfile/255459/1 "2026-11-13T19:16:58Z")

</div>

I am aware that I need static leases, and stuff.

What is the most simple way to assign such names? The list of static leases contains my boxes, but I can't ping them.  
E.g. have a box with foo as hostname, with MAC address, IPv4 address, ... in the list. Instead of reaching it through ping 192.168.23.34, I'd like to reach it by its hostname, that is ping foo. Unfortunately, it doesn't do that; and neither does ping foo.lan for active leases.

I did a search and found some sources, but they were all command-line based, several lines, whatever. I was hoping to be able to associate a hostname together with its IPv4 address when creating the static lease.  
Is this possible?

---

<div class="post-metadata">

**Author:** ![howl](https://forum.openwrt.org/user_avatar/forum.openwrt.org/howl/32/135606_2.png) [@howl](https://forum.openwrt.org/u/howl)\
**Post date:** [November 13, 2026, 7:36pm UTC](https://forum.openwrt.org/t/simple-host-names-hostfile/255459/2 "2026-11-13T19:36:25Z")

</div>

You can do it with just LuCI going to Network -\> DHCP -\> Leases -\> Add:

Insert the hostname you want to assign, the MAC address, the IPv4 you want and toggle on Forward/reverse DNS.

Save and then Save & Apply.

Edit: Just to ensure you understand what I have tell you to do. I have guide you to set a static lease while also adding into dnsmasq a record that will be resolved even if the device has not yet ask for DHCP server.

You can also leave Forward/reverse DNS toggle off and unset the hostname, that way the dns record will only exist if the lease is in the DHCP leases file and allow you to change the hostname in the device and not setting a "fixed" one in the router.

---

<div class="post-metadata">

**Author:** ![krotname](https://forum.openwrt.org/user_avatar/forum.openwrt.org/krotname/32/139139_2.png) [@krotname](https://forum.openwrt.org/u/krotname)\
**Post date:** [November 14, 2026, 7:19am UTC](https://forum.openwrt.org/t/simple-host-names-hostfile/255459/3 "2026-11-14T07:19:42Z")

</div>

Adding to the steps above: after the static lease with Forward reverse DNS, make sure clients use the router for DNS and the LAN domain matches. Check Network DHCP and DNS General Settings for Local domain (default lan) and that client DNS points at the router. Then flush client cache or reconnect, and test with nslookup foo against router IP before plain ping foo. If nslookup against the router works but short name fails, the client uses another DNS or search domain, not the dnsmasq record.
