1

I switched from a 192.168.0.0/24 network to 10.10.10.0/24. The addresses are provided by dnsmasq-dhcp.

The switch went fine for all devices but one - a printer (called PRINTER). This printer was assigned a fixed IP based on its name defined in /etc/hosts (via dhcp-host=PRINTER) and still does with the new ranges.

When it requests an IP address, the DHCP server states in its logs that

dnsmasq-dhcp:  not giving name PRINTER to the DHCP lease of 192.168.0.20 because the name exists in /etc/hosts with address 10.10.10.20

I do not understand this message: the name indeed exists in /etc/hosts, with now the new 10.10.10.20 address. While I guess that the DHCP query from the printer hints about the old IP address it used to have, why doesn't dnsmasq just ignore that and provide the new IP address?

WoJ
  • 3,607
  • 9
  • 49
  • 79

2 Answers2

1

Check if your printer name for old ip is here: /var/lib/misc/dnsmasq.leases and edit that file, you must stop dnsmask first

check the Lease times you setup when you configured dhcp, if you assigned too much time then it will take a while to "fix "itself

arana
  • 253
  • 3
  • 10
0

First off, I will assume that your printer is properly implementing DHCP and DDNS updates, but this is not always true. I am also assuming that the original lease it obtained has not expired yet. If you are getting this message after expiration, then you might be dealing with an improper DHCP implementation.

Your printer obtained a lease of 192.168.0.20, and was told that it would be valid for X number of days. Some time before that, you changed the range to 10.10.10.0/24. The printer still has an address lease that is technically valid, although undesirable.

During a lease, it is common for a device to request a lease renewal and/or a DDNS update. The lease renewal is obviously declined, since the original address is no longer valid for new leases, but that doesn't mean the printer will stop using it. It might not request a new address until the original lease has fully expired. This is not a bug.

The name update seems to be what is triggering the error, though. Depending on your configuration, it could be the printer requesting the name renewal, or the DHCP server requesting the renewal on behalf of the printer. The name renewal is being rejected since the address it's tied to is no longer a valid address on the server. The server parts are smart enough to know this, but the device will hang on until the bitter end before trying again, and probably succeeding.

The renewal process is basically the client or its agent asking if it may please continue using this name on that address. The server gets to answer "Yes," or "no," but does not get to say "No, but use this one instead."

The shortcut is to get your printer to release its lease and get a new one. You can usually do this through the web interface, or sometimes a power cycle.

GuitarPicker
  • 404
  • 2
  • 8