client.setServer(brokerIP, 1883);brokerIP is the IP address of my raspberry pi, and that's worked well. The issue is that my Pi obtains the IP address via DHCP and so for the sake of robustness, I would much more prefer to connect using it's mDNS name "raspberrypi.local". When I replace the IP with the name, it compiles and just fine and connects to my AP, however it cannot connect to the MQTT broker.
If I copy and paste the name into Putty and try to SSH, I'm asked to log in like normal, so I know the name is correct. Does anyone know what I'm doing wrong that I can SSH into my Pi using the mDNS name, but not connect using my ESP?