Yesterday I was able to ssh into my development box by using the machine name. Today, I can't. I can nslookup and use chrome to navigate to my box using just the machine name. ping and ssh do not resolve with just the machine name. Everything resolves if I use the fully qualified domain name. It all also resolves if I use the ip address. I am on an internal network (10.0.0.x).
$ dscacheutil -flushcache; sudo killall -HUP mDNSResponder
$ nslookup my-dev-box
Server: 10.0.0.113
Address: 10.0.0.113#53
Name: my-dev-box.thedomain.internal
Address: 10.0.0.106
$ ssh my-dev-box
ssh: Could not resolve hostname my-dev-box: nodename nor servname provided, or not known
$ ssh my-dev-box.thedomain.internal
password: xxx
Have a lot of fun... (it worked)
When I have ssh'd into my development box, I use the hostname command and it returns my-dev-box.
When I type my-dev-box into chrome, it takes me to my development site just fine.
In system preferences, on my wireless network (I'm on wireless for all this) in the DNS settings I have thedomain.internal listed under search domains.
What setting am I missing or how would I troubleshoot / restore ssh using a less fully qualified host name?
EDIT
So far the solution was to restart my macbook after all the steps above. SSH is working like it did before (connecting with just machine name on internal network.) Still don't know the cause of the error.
.bash_profilelikealias my-dev-box='ssh my-dev-box.thedomain.internal'or fill your~/.ssh/configand put this in the~/.bash_profile:[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp sshto have an autocomplete feature for ssh connections – Asmus Nov 13 '13 at 17:02mDNSResponderin the first line? That might kill dns lookups: http://support.apple.com/kb/HT3789?viewlocale=en_US&locale=en_US – Asmus Nov 13 '13 at 17:16mac.development.internalas opposed tomac.internal? I've just found this blog post where they post a similar scenario. Also: dohost my-dev-box,ping my-dev-boxanddig my-dev-boxall produce the same error? Since they all use different methods this might help find the cause. – Asmus Nov 13 '13 at 18:45