I am trying to set up a VPN with a Raspberry Pi, and the first step is gaining the ability to ssh into the device from outside my local network. For whatever reason, this is proving to be impossible and I haven't the slightest clue why. When I try to ssh into my server with user@hostname, I get the error:
ssh: Could not resolve hostname [hostname]: nodename nor servname provided, or not known
However, I can log into the server with,
ssh user@[local IP]
The server is a Raspberry Pi Model B running the latest distribution of Raspbian and the machine I am trying to connect to it with is a Macbook Pro running Mavericks. ssh was enabled on the Raspberry Pi when I set up Raspbian.
I have perused Stack Overflow for hours trying to see if anyone else had this problem and I have not found anything. Every ssh tutorial I find says that I should just be able to set it up on the remote machine and log in from anywhere using a hostname, and I have never had success with that.


[hostname]you're using cannot be resolved from where you're trying it from. Doesnslookup [hostname]give you back the[local IP]you're expecting?nslookup [hostname]spits out; Server: 8.8.8.8 Address: 8.8.8.8#53 ** server can't find [hostname]: NXDOMAIN when run from my Macbook[hostname], right?Server: 192.168.0.1 Address: 192.168.0.1#53 ** server can't find mrddr: NXDOMAIN