Access by IP address but not URL?

One laptop on our network exhibits strange behaviour occasionally. It will be working fine, then will suddenly lose the ability to access a website or any other server by its domain name.


Using Network Utility to lookup the address, the DNS responds with all the correct information. And in Terminal, nslookup and dig both correctly resolve the domain name to the IP address.


However no other application seems able to use this information. Safari, Mail, Software Update all fail to connect to the requested servers.


Mac OS X 10.6.8, MacBook Pro 2.66 Ghz Intel Core i7


Hope someone can assist


Cheers


James

Posted on Nov 14, 2011 4:26 AM

Reply
9 replies

Nov 14, 2011 1:08 PM in response to X423424X

It's nice of you to reply. But the existing DNS server (which by the way is on our LAN) is giving the proper answers.


This only happens with *one* computer on the network, and then only sometimes. But when the computer is exhibiting this problem, dig and nslookup both resolve IP addresses correctly - but apps like Safari and Mail seem unable to use this information.


The only way I have found of sorting this is to restart the client computer, at which point it works fine.


Logging out and back in as a different user has no effect.


Any ideas?


Cheers


James

Nov 28, 2011 10:29 AM in response to James Knight3

Check /etc/hosts


You can override normal lookups by setting a hostname in /etc/hosts to give it a different IP address.

Safari (and just about every other application) will use the system resolver to resolve the hostname, and that first checks /etc/hosts to see if an entry exists. If it does, it uses that address rather than whatever DNS would say.

However, dig specifically queries the name server, so will return whatever DNS says, completely ignoring /etc/hosts and any caches.

Nov 28, 2011 11:44 AM in response to Camelot

Thanks Camelot - that would be fine if this was one IP address I was having problems with. But that's not it. No URLs at all can be accessed - whether hosted locally or on the internet. Both dig and nslookup resolve IP addresses correctly but the URLs do not work.


From your post, it sounds as thought the system resolver may be at the root of the problem. But I have no idea how I would go about unclogging it?


Cheers


James

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Access by IP address but not URL?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.