How to get a list of IPs in a LAN using NodeMcu?
You should use mDNS.  Install (if it isn't already) avahi-daemon on your Raspberry. 

Then check out the ESP8266mDNS library and the examples it has. Especially the mDNS-SD_Extended example, which performs a query for a service on the network.