Using hostname.local

I have an ESP8266 module that sends information over WiFi to a Raspberry Pi Zero Wireless EasyIOT web server. The Raspberry Pi is set up with a hostname.local IP address and I can communicate with it from other computers just by typing 'PaulsRaspberry.local' into the browser address bar.

On the ESP8266 the program has a define statement with a static IP:
#define EIOT_IP_ADDRESS "192.168.1.5"

The problem is that every time I boot the RPi, 'PaulsRaspberry' is resolved to a different DHCP IP address and I need to find out what that is, change the code in the Arduino IDE, compile and upload to the ESP8266. I know that I can use a static address on the Raspberry Pi, but I gather from reading various network pages that from a network point of view, static adresses are not favored. How can I change the code to return the IP address from the PaulsRaspberry.local name and then use that in the #define EIOT_IP_ADDRESS statement?

Thanks,

Paul

We used static IP addresses for a network of test instruments at work.
Not a problem.

The term you're looking for is mDNS.

Pieter