# Another slow DNS issue

## drawsmcgraw

Forgive me for contributing another one of these posts, but I honestly have not found solutions in the forums thus far... 

I have the usual, I use Firefox (1.0.6) and whenever I punch a URL into the browser, I sit for about 10-60 seconds staring at the little "looking up site.domain". Once it's connected, the speed is fine, so I don't believe it's a speed issue. Further, when I use dig to test out my DNS abilities I get no problem:

```

[drew@Lugh drew]$ dig www.cnn.com

; <<>> DiG 9.2.3 <<>> www.cnn.com

;; global options:  printcmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2452

;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:

;www.cnn.com.                   IN      A

;; ANSWER SECTION:

www.cnn.com.            80      IN      A       64.236.16.52

;; Query time: 11 msec

;; SERVER: 192.168.0.1#53(192.168.0.1)

;; WHEN: Sun Aug 21 09:22:36 2005

;; MSG SIZE  rcvd: 45

```

This is an immediate response, and it can't be cached because I never mentioned cnn.com to my Gentoo box before that dig command.

So I'm getting a DNS answer right-away; then why is Firefox sitting there saying "looking up..."?

I spent the summer in a densely populated metropolitan area and had no problem browsing, but I come back to my home town (much, much smaller place) and this happens. This was also an issue *before* I left for the DC area.

Background information:

*I'm behind a netgear router, MR814V2. This is not my choice, I recently came under certain circumstances and am borrowing this one from a friend.

*I'm on a 1Mb cable connection with a Motorola surfboard modem.

And just for thoroughness, because I'm convinced my files are messed up:

/etc/hosts:

```

[drew@Lugh drew]$ more /etc/hosts

127.0.0.1       localhost localhost.localdomain

```

/etc/resolv.conf

```

[drew@Lugh drew]$ more /etc/resolv.conf

nameserver 192.168.0.1

```

/etc/conf.d/net

```

iface_eth0="dhcp"

gateway="eth0/192.168.0.1"

```

And 192.168.0.1 is the Netgear router.

I'm lost. Please educate me. And thanks in advance.

----------

## ikaro

what if you add the nameservers from your ISP into the resolv file, instead of the router ?

see if you get the same delay using 'dig www.cnn.com @192.168.0.1'

----------

## drawsmcgraw

```

[drew@Lugh drew]$ dig www.cnn.com @192.168.0.1

; <<>> DiG 9.2.3 <<>> www.cnn.com @192.168.0.1

;; global options:  printcmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55287

;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:

;www.cnn.com.                   IN      A

;; ANSWER SECTION:

www.cnn.com.            80      IN      A       64.236.16.52

;; Query time: 6 msec

;; SERVER: 192.168.0.1#53(192.168.0.1)

;; WHEN: Sun Aug 21 10:29:15 2005

;; MSG SIZE  rcvd: 45

```

No problem there....

 I thought about placing the DNS servers into my resolv.conf but this cable modem is a black box and I don't know any other way to find out my name servers. Doesn't seem to be a problem using my router anyway... I have this same issue with Thunderbird as well. Also, interestingly, when I try to ping a site I got nothing:

```

[drew@Lugh drew]$ ping www.cnn.com

PING www.cnn.com (64.236.16.52) 56(84) bytes of data.

--- www.cnn.com ping statistics ---

21 packets transmitted, 0 received, 100% packet loss, time 19999ms

[drew@Lugh drew]$ 

```

Though this is splotchy at best. Sometimes I'll ctrl-C and it will report that it received one or all replies back so... I'm still at a loss....

----------

## ikaro

maybe the router is filtering icmp packets.

email your isp and ask them for the nameservers.

usually its on their website, under support and faq.

----------

## drawsmcgraw

Well sunuvabitch!  I found a section in the router that tells which DNS servers it has. Plugged those into /etc/resolve.conf and I'm doing much better! Again, I've overlooked something  :Embarassed: 

So I guess what was happening was that my box was treating the router like a DNS server and, naturally, the router had no idea what it was talking about and I was just waiting for.... well, what happened if all I had was the router for the DNS server? There was no other IP for it to fail over to... somehow the router forwarded the requests to the DNS servers that it knows??? I don't understand.... but at least I can surf better!  Thanks a bunch!

----------

## laurentgedm

The thing is, in WinXP the name server is configured as the router's ip. And it's fast.

I think it's strange that digging, emerging, ping-ing is fast and not web browsing. I'm talking about the name resolving (is this the right word? english isn't my motherlanguage).

----------

## drawsmcgraw

That's what I don't get. Name resolution only seems to be a problem when a browser or e-mail client is trying. I feel dumb now....

----------

## laurentgedm

Possibly a bug ine kdenetwork or something? 

(i'm noob, please don't kill me if i'm saying something stupid)

Browsing www.gentoo.org in lynx was fast as hell, unlike in firefox...

----------

## drawsmcgraw

Interesting... Does Firefox use kdeNetwork? I'm curious mostly because I'm running Fluxbox, and kdeNetwork makes me think of, well, KDE.

----------

## laurentgedm

This was just an idea. I'm using kde, so i thought of it.

But as dns resolving is fast in consoles and slow in X clients, couldn't it be a problem with an intermediate layer?

----------

## drawsmcgraw

Very likely. But, being just a user, I have no idea where to start on that.

----------

## Venoms

I've been using both flux and kde, both are slow as h*ll compared to windows xp.

At the moment, my Gentoo is down...disk replacement, so I can't try anything but I did everything you guys said but with no improvement. The nameres are slow and ping's are fast as expected.

Btw, I tried Opera Firefox and that default one in kde, can't remember the name, all have same speed.

I had static dns from my isp so that was not the problem. Maby it could be the dns cache you talked about. I will try that in next install, and let you know the result.

edit:

If you go to a site that you never visited before, then it could not be cached. The second time it still slow, but not that slow, because of the cache in the browser, I'll guess. So, a dns cache would do something nice here...

----------

## laurentgedm

Are we all running an amd64 system?

I'm filing a bug.

EDIT: Bug#:   	 104389

----------

## Venoms

 *Quote:*   

> Are we all running an amd64 system? 

 

Nop, I have one Intel P4 2,8 ghz Prescott, 1,5gb ram 2x120gb Maxtor sata 1x40gb maxtor 133 Pata and Ati r 9600 256

Broadband 26 mbit

----------

## laurentgedm

All right. There are too few people who have this problem, they won't help us. I didn't file my bug correctly, i should have mentioned more threads talking about slow dns. 

The only solution i see is a patch called winxp. It always works. Ugly, but it always works.

Good luck.Last edited by laurentgedm on Tue Sep 06, 2005 12:57 pm; edited 1 time in total

----------

## nixnux

A long time ago I had problems with this too.  I couldnt resolve any hostnames in under 10 seconds.  Going to a webpage would go slow, then it'd start to load up an add or anything that requires another lookup and it'd hang for another 10-20 seconds.  It also worked fine in windows.  What I did find out though is that windows seems to take a dns that isnt online, or really slow, and ignore it and go on to the next.  What I did was change my settings in my router so that it reported worked dns's to my dhcp clients.  My problem was that it tried to use a dead dns before each lookup.  Hope this helps

----------

## File_Mangler

The problem isn't specific to Firefox or Gentoo either. I've had similar issues when using Knoppix v3.9 and newer. The wm I used was KDE. Browsers tried: Konquerer, Netscape, and Firefox. I haven't tested other wm's, although Links works just fine (nonGUI).

----------

## Decibels

Two things I did to speed up my browsing worked for me:

Firefox is defaulting to IPV6 lookup, so changed that to false:

```
about:config and change 'network.dns.disableIPv6' to true
```

Then pinged my ISP's DNS boxes, found my secondary was faster by half, so switched the primary and secondary.

Then restared the network. 

Much faster.

----------

## PaulBredbury

If DNS resolving is the problem, then the simple answer is to run bind, so you are not dependent on your ISP's nameservers.

----------

