title: ssh: Could not resolve hostname. Name or service not known
body: <p>I'm trying to set up hadoop on my amazon instances, on a 2 node cluster. Each instance has a public dns, which I use reference them. So in the /etc/hosts files on both machines I append lines like this:</p>
  
  <pre><code>{public dns of 1st instance} node1
  {public dns of 2st instance} node2
  </code></pre>
  
  <p>I'm also able to ssh into each instance from the other by simply doing:</p>
  
  <pre><code>ssh {public dns of the other instance}
  </code></pre>
  
  <p>In the the hadoop/conf/slaves on the first instance file I have:</p>
  
  <pre><code>localhost
  node2
  </code></pre>
  
  <p>When I start the script bin/start-dfs.sh
  It's able to start the namenode, datanode, and secondary namenode on the master, but it says: </p>
  
  <pre><code>node2: ssh: Could not resolve hostname node2: Name or service not known
  </code></pre>
  
  <p>The same it printed out if I try:</p>
  
  <pre><code>ssh node2
  </code></pre>
  
  <p>I guess the question is how do I tell it to associate node2 with the public dns of the second instance. Is it not enough to append the</p>
  
  <pre><code>{public dns of 2st instance} node2
  </code></pre>
  
  <p>line to the /etc/hosts file?
  Do I have to reboot the instances?</p>