I have a development server on my LAN with a static IP address. My DD-WRT flashed router assigns the domain 'server.local' to the static IP of the server. Everything worked fine with my setup. I could connect to the server via ssh, ftp, http, ping, or even samba.

I just did a clean install of CentOS on the server, and everything is working fine when I connect to it from any of my Windows machines. However my Macbook won't connect any more. I can view my development versions of my websites in a browser, but I can't ssh in to the server.

I cleaned out ~/.ssh/known_hosts to make sure the old server's information wasn't mucking things up. How are the Windows machines and Mac browsers able to find the server, but Terminal can't?

Edit #1:

~: ssh root@server.local
ssh: Could not resolve hostname server.local: nodename nor servname provided, or not known
~: ssh root@
root@'s password:

Edit #2:

I already tried flushing the DNS cache by dscacheutil -flushcache. I'm on OS 10.6.

Ok, so why is Terminal confused about the domain name when browsers are not?

Adding server.local to /etc/hosts fixes the problem. I'm just wondering why it's not able to rely on the router's DNS.

  • can you please try flushing your dns cache with this command dscacheutil -flushcache and restarting your browser. Let us know if you can still access server.local with your browser? – robzolkos Apr 27 '11 at 2:12
  • I forgot to mention that I had done that. I'll update my question with that and my OS X version. – Preacher Apr 27 '11 at 2:13
  • Looks like a DNS problem to me. try host server.local. If you cannot resolve it, add server.local to your /etc/hosts. – Sebastian Roth Apr 27 '11 at 3:03

Mac OSX 10.6 does not respect DNS responses with a TTL (time to live) of 0 (which is what DD-WRT based routers are set to by default). You will need to go into the DD-WRT router and into the Administation -> Services tab. You will see a box called Additional DNS options. Add the following value to this box :


Save and reboot your router and your Mac, and you should be able to see server.local in terminal (without having it in your hosts file).

  • This didn't work either. – Preacher Apr 27 '11 at 13:32

Mac OS X reserves the ".local" extension for mDNS. As far as I know, it can't be turned off. You either have to turn on mDNS on your server, pick a different extension for your network, or modify your /etc/hosts/ file with an entry for your server.

  • But why would the browser on the Mac go to server.local but not in terminal. Thats the bit I don't get. – robzolkos Apr 27 '11 at 3:33
  • @RobZolkos That I don't know. – Kyle Cronin Apr 27 '11 at 3:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .