Static leases not showing correct IP address

I have historically got several devices with static leases and these can be picked up (with the correct assigned Ip address) and added into hostnames

I have recently tried to assign some more static leases to some additional devices. They show up in the Server Settings of the Static Leases tab with the newly assigned IP number (it is unique).

But when I go into the Hostnames, host entries and try and add these newly ip configured devices they are still showing the old (DHCP assigned) IP address. They also dont ping (but do on the old ip address).

They also dont ping on either IP address now.

Ive also rebooted the router.

What am I doing wrong?

Set both the IP and the hostname within the static lease. When the DHCP client with matching MAC address requests a lease, the hostname will also be entered into the table.

The /etc/hosts hostname table is useful mostly to get DNS lookup of hosts outside the LAN, such as on the other side of a VPN. Or if you have a LAN device with a static IP set locally on it, which is the old way of doing things and generally not recommended.

1 Like

In /etc/config/dhcp:
If you want to have a dns entry for the static lease add the dns 1 option:

config host
        option name 'rockpi'
        option dns '1'
        option mac 'FF:FF:FF:FE:EE:EE'
        option ip '10.0.2.5'
        option leasetime '1d'
        option hostid '5'
        option duid '000100....'

In case of just a hostname entry or cname, in the same file:

config domain
        option name 'gigaset'
        option ip '10.0.2.32'
1 Like

You need to perform DHCP release/renew from the clients.
Or, restart the clients and the router.

2 Likes