Could not ssh to nerves.local

I’m working on a new nerve project following the getting started guide Getting Started — nerves v1.10.0.
Whenever I try to ssh nerves. local I’m getting an error

ssh: Could not resolve hostname nerve.local: Name or service not known

Is there a step/configuration that I’m missing out?

Hello, just to check and confirm some basic stuff just to be safe.

It should be ssh nerves.local with no space after nerves.

Also, it should be nerves plural rather than singular.

Before attempting to SSH into your target device, you’ve already:

  1. built the firmware for the target device
  2. burned the firmware onto a bootable SD card for the target device
  3. inserted the SD card into the target device
  4. connected your computer to the target device (see: Connecting to Nerves Target — nerves v1.10.0)
  5. powered on your target device

Also, what device are you targeting? A common gotcha according to this walk through guide Getting Started with Elixir and Nerves: Part 1 is to make sure you set the right MIX_TARGET environment variable for the device you are targeting.

Many commands won’t run if you don’t set MIX_TARGET and its not always obvious what is wrong. This was mentioned to me at the conference but it has bitten me several times since.

1 Like

“ssh: Could not resolve hostname nerve.local: Name or service not known” typically means that the hostname “nerve.local” cannot be resolved to an IP address by the DNS server.

Some thoughts:

  • Is the target device on the same network as your computer?
  • Does the target device has a hostname configured?
  • Is your computer’s DNS server able to resolve the hostname. Run nslookup. Also you can make an entry for the hostname in the /etc/hosts file on your computer.
  • Is your MIX_TARGET environment variable correct?

Hi @Tee!
It may be useful to know what’s your target device and how are you trying to connect it, because there are many possibilities: USB data cable, Ethernet, WiFi… But these options also depends of your target.

If you give us more information about it, I am sure someone could help you to start with Nerves!