Devices get a strange gateway or DNS server, and you suspect a second router is handing out addresses. This script sends a DHCP request on the local network and reports the offers.
sudo nmap --script broadcast-dhcp-discover
No target is needed. For each reply you see details such as the offered address, the server identifier, subnet mask, router, DNS servers and lease time. The server identifier is the part I’d compare with the address of the box that is supposed to do this job. If it is something else, you have found your extra DHCP server, often a spare router or a mesh unit left in router mode.
By default the script waits 10 seconds. A slow server can be given longer:
sudo nmap --script broadcast-dhcp-discover --script-args broadcast-dhcp-discover.timeout=20
It uses a fixed MAC address on purpose, so repeated runs don’t drain the address pool. Leave it that way.
It needs root, and it only hears servers in the same broadcast domain, so run it from the network segment where the problem happens. If two servers answer, don’t assume you have seen them all after one run. Run it a few times. Use it on your own network only.
Further reading: broadcast-dhcp-discover script