Hi @Ghazanfar_Rizvi1
Welcome to the community!!

From the above error, seems like the connection does not work with the url specified.
Can you try configuring the IP and the Port manually to the /etc/hosts/ in the following format:

hostAliases:
    - hostnames:
      - "abcd.xyz.com"
      ip: "10.10.10.10"
    - hostnames:
      - "mongodb.example.com"
      ip: "10.10.10.11"

It would be good if you could share the pod logs or do a kubectl decribe po <podname> to have more information for the same.

Please let us know if you have any further questions.

Thanks
Aasawari