OSX: ssh: Could not resolve hostname xxxxx.com: nodename nor servname provided, or not known

I'm trying to ssh into my ec2 instance using:
Code Block
ssh -i "key.pem" ubuntu@xxxxx.com

And I get this:
Code Block
ssh: Could not resolve hostname xxxxx.com: nodename nor servname provided, or not known


This is not an ec2 problem because replacing xxxxx.com with public-ip-address works just fine.

This is also unlikely to be a DNS problem because:
  1. nslookup for xxxxx.com returns the correct IP

  2. I can SSH into the machine using the exact command above from *another ubuntu machine*

So this must be an OSX issue. Ping also doesn't work:
Code Block
ping: cannot resolve xxxxx.com: Unknown host


I tried everything here but no luck.

What else can I do?

PS in the unlikely event that it matters it's actually not a .com domain but a more esoteric .land. Could this cause any problems?

OSX: ssh: Could not resolve hostname xxxxx.com: nodename nor servname provided, or not known
 
 
Q