Pod failed to mount a Portworx volume - connection refused error

I am deploying Portworx on Kubernetes environments using the spec yaml generated on install.portworx.com. I can create a PVC using a Portworx Storage Class but when I am trying to mount the volume it fails on some environments.
The logs show its trying to connect to an IP which is wrong but I am not sure where it is getting it from.
For example:

MountVolume.SetUp failed for volume "pvc-2cb7697b-4bdf-11e9-a7f6-000c29e98f02" : Get http://node1:9001/v1/osd-volumes/versions: dial tcp 10.0.0.10:9001: connect: connection refused

This usually happens when your DNS is not properly configured to resolve the node name.
In the example above node1 is resolving to IP 10.0.0.10 which is likely not the correct one in this case.
To resolve this problem you can fix DNS resolution for your Kubernetes cluster to resolve node1 to the correct IP, or as quicker fix you can update /etc/hosts in all nodes with correct hostnames and IPs.