Friday, June 30, 2006

 

Linksys DNS Timeout Problem

I figured out why the Linksys WRT56G, v5 802.11g wireless router is making DNS queries time out. I used my favorite packet sniffer, called WireShark, to watch what happens when I tell a DNS query program to use my router as the root server. I got very different results from DIG and nslookup.

DIG tries to establish a Transmission Control Protocol (TCP) connection with the router, and the router completely ignores it! Nslookup, on the other hand, uses the connectionless User Datagram Protocol (UDP), and the router responds instantaneously! Voila! Mystery solved!

I'm still looking for a way to make the Linux DNS server use only UDP for queries, but I think I will find it's not possible and it's inadvisable. My understanding is that UDP is fine for short responses, and that TCP is necessary for long responses that get truncated. I bet people who use the Linksys router as their DNS server are unable to reach sites that have long responses.

I did a lot of searching last night, and it looks as if Mac OS X users are having the same problems with the Linksys router, and I'll bet it's for exactly the same reason. The "common wisdom" is to configure the Mac with real DNS server addresses, but if the server addresses ever change, they'll be screwed. That's the whole reason it's desirable to use the router as the DNS server in the first place: it gets the latest DNS server addresses from the ISP using the Dynamic Host Configuration Protocol (DHCP).

technorati tags:, , , , , , ,


Comments:
It strikes me that the right solution is even simpler. Given that there is no need for two-faced NAT (where the NAT re-writes the outside IP address in DNS responses), the wireless AP could just give out the external DNS server as the DNS address. It doesn't need to provide DNS unless there is no outside server available. (And if it is a bit limitted when the outside world is missing, that's okay.)

Yours,
Joel M. Halpern
 
That's a great solution. Unfortunately, I'm not using the router as a DHCP server, I'm running my own DHCP server, and a DNS server that needs to forward to the ISP's servers or to the router. :-(

On the bright side, I just ordered a WRT54G*L* (where "L" is for Linux). I didn't know Linksys made a Linux device until I read something about it a couple of days after I bought my last Linksys router. At least with 3rd party Linux firmware I'll be able to get things working right. I'll program it myself if I have to.

Another alternative on my Linux server is to scrape the DNS server addresses off the Linksys configuration screen.

Thanks for the comment, Joel.
 
While reporgramming the Linksys may help, I suspect the simples thing is to have your server get the DNS Server address from the router.

In practice, I doubt that your provider changes DNS server addressses very often. So manually configuring those addresses (as you are doing) is probably sufficient.

The normal alternative is to arrange for access to two real DNS servers at well known addresses, with arrangements for them to accept recursive calls from you. That costs money, and is often packaged with commercial services.

There has been some work on local service name resolution to complement DNS. Apple has techniques for this. I don't know if anyone else has fielded solutions. The one proposed to the IETF had the problem that it tended to leak into real DNS space. (Microsoft essentially proposed the use of a .local tld, with alternative resolution techniques.)

Yours,
Joel
 
The WRT54G is linux based and the firmware is known to have lots of problems. Because it was based on opensource, there are several free, and almost free firmware repalements should consider getting.
 
Hey, Awesome blog. i think this is perfect Solutions....!!!!, Really very impressed reading by your content!! Good work!! Keep it up!!!

Linksys Router Support
 
Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?