title: AWS EC2 SSH Could not resolve hostname nodename nor servname provided, or not known
body: <p>Yes, there have been many postings for many years with this issue.  Their solutions haven't worked for me.</p>
  
  <p>I was having no trouble SSHing into my ec2 instance from my Mac terminal until I setup Elastic IP and Cloudfront.  That went well and the original IP for the instance has been replaced and it is serving the Web pages for my domain.</p>
  
  <p>I thought all I had to do for the new IP was to change the Public DNS in the SSH string to the new one.  Then I get the error.  If I use the old one I get the same error.  There is no DNS issues because the site has been working for days. Also, in Webstorm I made the change to the host in the deployment preferences and I can SFTP into the instance without a problem with the same .pem file as before.</p>
  
  <pre><code>ssh -i "path/to/ubuntu.pem" ubuntu@ec2-xx.xx.xxx.xxx.us-west-1.compute.amazonaws.com
  </code></pre>
  
  <p>The part after the @ sign is a copy from my ec2 instance.</p>
  
  <p>So the question is, what changed when I moved to Cloudfront and Elastic IP besides the IP?  Why is this only affecting SSH and not SFTP?  Why did the routine login become a nightmare to solve?</p>