Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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@192.168.1.200
root@192.168.1.200'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 192.168.1.200 server.local to /etc/hosts fixes the problem. I'm just wondering why it's not able to rely on the router's DNS.

share|improve this question
    
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
add comment

2 Answers 2

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 :

local-ttl=5

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).

share|improve this answer
    
This didn't work either. –  Preacher Apr 27 '11 at 13:32
add comment

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.