17 มีนาคม 2551

Wrong DNS causes interesting glitch by Anthony Lawrence

I had an interesting call a few days back. Old customer, old SCO box overdue for the graveyard but still in use. Customer needed to renumber his ip scheme and ran into a confusing situation after changing from 192.168.2.x to 10.126.10.x.

Here are the observed conditions:

"ifconfig" shows correct address, broadcast, mask.

"netstat -rn" shows correct routes.

"netstat -in" does show a high number of collisions.

Nothing funky in /etc/hosts.

Ping a local machine or the router, ping hangs.

Delete the default route and ping works.

On the face of it, this is wrong. Local LAN packets have nothing to do with the default route; it shouldn't matter whether it has a route or not - local packets don't need to go through the router..

I should have realized what this was instantly, because there is something that local packets could need the router for.. I'll give you a second to think about it..

Ok.. that's long enough. The reason I didn't hit on this instantly is because I had talked to the admin there and reminded him that he needed to change /etc/resolv.conf as part of this work. Unfortunately, he forgot it - well, he remembered that he *needed* to do it, but never actually did it. So resolv.conf still pointed at a 192.168.2 address for a nameserver.

Why does that matter? Because of reverse lookups. Every packet coming in needs to be resolved to a name if possible. The resolver looks at /etc/resolv.conf to find out how to do that, and of course it found that 192.168.2.x address. Without a default route, there would be nothing it could do with that: it can't ask the name server to resolve any ip's because it has no way to get there. Therefor it instantly gives up, and the ping works.

But with a handy default route, it's going to try to reach the name server. That might have been OK if the router knew nothing about any 192.168.2.x addresses and had said so instantly, but apparently it tried to route that.. I'm not sure where, though they do have hardware VPN's also, so that may be where it sent the packets. Whatever actually happened, the resolver requests would never be answered, so everything had to wait for a timeout.. I don't know how long that is configured for on that router, but whatever it is, it was plenty long enough to hang ping.

Putting the correct DNS server into resolv.conf solved this instantly (there's no need to reboot - the resolver notices changes to resolv.conf immediately).

I don't know where the collisions came from.. but I wasn't asked to do anything more, so I left that to the normal admin. The system worked at this point and the collisions were not increasing.

 

Don't buy a Mac by Anthony Lawrence

A month or so back one of my computerless neighbors told me that he and his wife were ready to join the Internet Age and asked if I'd be willing to give him some advice. Of course I said yes, and told him to call me as he got closer to actual purchase.

I saw him a few times after that, and about a week ago he said he was "real close". I chatted with him a few minutes about Macs and PC's, strongly recommending the Mac, and especially made a point to tell him about PC Magaine choosing Mac OS X as the best consumer OS.

On the flip side, I also know that his son works somewhere in the computer field, so I said that if his son would be helping him regularly with problems, he should ask his son which platform he'd prefer.. that makes obvious sense, I think.

Two days later I ran into him again and he said "We bought a computer. Windows". I assumed he had talked to his son and decided on that basis, but no, his wife "had used Windows at work" so they went with that. I didn't have the heart to tell him that she had probably used XP at work and that Vista wasn't going to be anything like what she was used to, but I did ask where he had bought it. "Best Buy, twelve hundred bucks".

I probably should have kept my mouth shut, but I couldn't help reacting. This guy just needs email and Internet: he doesn't need an expensive computer. I blurted out "Oh, gee, you paid too much!"

"That included a printer", he retorted. Again I should have just shut up, but I like these people and I hate seeing them get taken. "A printer is about seventy bucks", I said.

"And they are coming out to the house to set it up!" he exclaimed.

Great. There's probably two hundred of it, and totally wasted. "Aren't you getting Verizon FIOS?", I asked, knowing the answer already. He affirmed that. "Well, you need the computer set up with FIOS, but there's really nothing to it - and Verizon will do it anyway."

He stared at me for a few seconds. "Well, too late now.". This time I did shut my mouth. Of course it's not too late: he could take that right back to Best Buy and get all his money back. He could spend far less and get a perfectly good system, Apple or Windows, and he sure as heck doesn't need to pay them to "set it up".

Oh well.. I tried. But I do have to wonder: why did he even bother to ask me?