OSCSender connect to hostname

Hello everybody, I am trying to connect my Juce application with an external hardware of which I know the host name via Bonjour.
but I noticed that if I use a name instead of an IPAddress for the
targetHostName parameter of the connect function, the application doesn’t work.
how should I do it?
best.
d