Unable to add an endpoint using the URL

I’ve been adding portainer agents as endpoints (raspberry pi’s) through the interface.
The only problem i’m running into is that the endpoint only seems to work if i use the pi’s IP and port.
When attempting the http url (same one i use to ssh to it so im confident it is correct) and the port it seems to refuse to add it? It’s the hostname of the raspberry pi and there is a dns server in the network.

Ive tried altering multiple parts of the hostname nothing seems to work.

Instructions I used, Add Docker Endpoint - Documentation

Hello @Ajayyyy I realize this is a little bit old, But did you get this resolved by chance? If not how did you configure the container? Did you give the container a host name did you give the container an url for it’s use outside the host?

Let me know if this helps you any at all,