måndag, maj 05, 2008

Faulty routes on MacOS X

This has been driving me insane, but I haven't had time to actually try to fix the problem until now, so this is a small writeup about the symptom and what you can do about it. Sadly, it's kinda a hard problem to search for, unless you already knows whats wrong.

This was my problem: At work, accessing LiveJournal worked fine, but at home it didn't. Basically I got a Server Not Found from Firefox when trying to access from home. After a while I realized that the distinction wasn't between home/work, but wireless or wirebound network. See, at work I usually use a wire to connect, but I only use wireless at home.

My first shot at a solution was something that solved a similar problem a while back - namely flushing the DNS cache. Of course, doing an nslookup and verifying it told me that the cache wasn't the problem, but I tried anyway, because MacOSX sometimes plays funny tricks with this cache. So, to do this, just do "sudo lookupd -flushcache" in a console window, and then restart the network interface.

I tried to figure out what was wrong by pinging, and doing traceroute. Both of these gave clues that something was wrong. Traceroute gave me "Can't assign requested address" from the bind system call. That finally made me realize that the route tables for the network interface was screwed. Lo and behold, doing a "sudo route flush" and restarting the interface solved my problems. Apparently there were about 10 faulty routes stuck in the cache, and for some reason MacOS X didn't flush this cache automatically when connecting to a different wireless network. Highly annoying, but it's finally solved.

3 kommentarer:

Yesgee sa...

I had the same problem too. my yahoo mail opened if i connected using the network cable and wouldn't if i went wireless. i was using the wap site of yahoo to check mails plus in a few weeks the router died anyway and a new one worked just fine... good to know that a workable solution exists though... i was using a PC and not a Mac

Anonym sa...

Unstated, but quite important, it was the same machine at work and at home. (I'm assuming)

Anonym sa...

Funny thing. I just had the same problem and remembered your post. Problem solved. I was helped by OpenDNS error screen in realizing that it was indeed a DNS problem.