Discussion:
Slow DNS Lookups on Debian Etch AMD 64
Dallas Clement
2007-05-10 14:41:59 UTC
Permalink
Hi All,

I'm getting terrible DNS lookup performance on my Debian Etch system.
I've installed the "Etch" - Official Beta amd64 version.

After installing, I noticed that the Internet browsers were taking a
really long time to pull up a web page. I also observed that the
browser delays seemed to be DNS related as they were spending a lot of
time "Looking up whatever.com...".

I turned off IPv6 and it made no observable difference.

It seems that a DNS lookup is taking 10s on average. Here is the dig
output for one such lookup:

debian:/# time dig 192.168.0.1 www.yahoo.com
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 52841
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;192.168.0.1. IN A

;; AUTHORITY SECTION:
. 7650 IN SOA A.ROOT-SERVERS.NET.
NSTLD.VERISIGN-GRS.COM. 2007050901 1800 900 604800 86400

;; Query time: 10 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Thu May 10 09:39:21 2007
;; MSG SIZE rcvd: 104


; <<>> DiG 9.3.4 <<>> 192.168.0.1 www.yahoo.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60232
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 8, ADDITIONAL: 8

;; QUESTION SECTION:
;www.yahoo.com. IN A

;; ANSWER SECTION:
www.yahoo.com. 41 IN CNAME www.yahoo-ht3.akadns.net.
www.yahoo-ht3.akadns.net. 44 IN A 209.131.36.158

;; AUTHORITY SECTION:
akadns.net. 146740 IN NS zc.akadns.org.
akadns.net. 146740 IN NS zd.akadns.org.
akadns.net. 146740 IN NS eur1.akadns.net.
akadns.net. 146740 IN NS eur7.akadns.net.
akadns.net. 146740 IN NS usw1.akadns.net.
akadns.net. 146740 IN NS asia9.akadns.net.
akadns.net. 146740 IN NS za.akadns.org.
akadns.net. 146740 IN NS zb.akadns.org.

;; ADDITIONAL SECTION:
za.akadns.org. 63940 IN A 204.2.178.133
zb.akadns.org. 63940 IN A 206.132.100.105
zc.akadns.org. 63940 IN A 63.209.3.132
zd.akadns.org. 63940 IN A 204.2.178.133
eur1.akadns.net. 4599 IN A 213.254.204.197
eur7.akadns.net. 4599 IN A 193.108.94.88
usw1.akadns.net. 4599 IN A 63.209.3.132
asia9.akadns.net. 4599 IN A 220.73.220.4

;; Query time: 10 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Thu May 10 09:39:26 2007
;; MSG SIZE rcvd: 368


real 0m10.031s
user 0m0.000s
sys 0m0.000s
debian:/#

This very same machine also has Windows Vista Ultimate 64 installed on
it and DNS lookups are lightning fast. There is definitely something
going on with Debian Etch or perhaps the network configuration. I am
using the ndiswrapper around a Windows driver for my Broadcom wireless
network adapter.

Does anyone have any ideas for me?

Thanks,

Dallas Clement
Douglas Allan Tutty
2007-05-10 15:43:24 UTC
Permalink
Post by Dallas Clement
I'm getting terrible DNS lookup performance on my Debian Etch system.
I've installed the "Etch" - Official Beta amd64 version.
What is an official beta of Etch which is the current Stable?

Send us your /etc/apt/souces.list after you have done an update and
upgrade, if the problem continues.

Doug.
Dallas Clement
2007-05-11 21:37:07 UTC
Permalink
Post by Douglas Allan Tutty
Post by Dallas Clement
I'm getting terrible DNS lookup performance on my Debian Etch system.
I've installed the "Etch" - Official Beta amd64 version.
What is an official beta of Etch which is the current Stable?
Send us your /etc/apt/souces.list after you have done an update and
upgrade, if the problem continues.
Doug.
--
Sadly, after upgrading to 4.0 r0 I am still experiencing the slow DNS lookups.

This is what's in my sources.list file:

debian:~# cat /etc/apt/sources.list

deb cdrom:[Debian GNU/Linux 4.0 r0 _Etch_ - Official amd64 DVD
Binary-1 20070407-12:15]/ etch contrib main

------

Thanks for the help.
Douglas Allan Tutty
2007-05-11 21:59:08 UTC
Permalink
Post by Dallas Clement
Post by Douglas Allan Tutty
Post by Dallas Clement
I'm getting terrible DNS lookup performance on my Debian Etch system.
I've installed the "Etch" - Official Beta amd64 version.
What is an official beta of Etch which is the current Stable?
Sadly, after upgrading to 4.0 r0 I am still experiencing the slow DNS lookups.
debian:~# cat /etc/apt/sources.list
deb cdrom:[Debian GNU/Linux 4.0 r0 _Etch_ - Official amd64 DVD
Binary-1 20070407-12:15]/ etch contrib main
You should add on lines after that lines that point to your mirror of
choice. Mine (in Canada) is:

deb http://ftp3.nrc.ca/debian/ etch main contrib non-free

deb http://security.debian.org/ etch/updates main contrib non-free

This ensures that you get the most up-to-date packages within Etch
(stable).

And if you want:

deb http://debian-multimedia.org etch main

deb http://volatile.debian.org/debian-volatile etch/volatile main \
contrib non-free
Dallas Clement
2007-05-11 23:49:17 UTC
Permalink
Post by Douglas Allan Tutty
Post by Dallas Clement
Post by Douglas Allan Tutty
Post by Dallas Clement
I'm getting terrible DNS lookup performance on my Debian Etch system.
I've installed the "Etch" - Official Beta amd64 version.
What is an official beta of Etch which is the current Stable?
Sadly, after upgrading to 4.0 r0 I am still experiencing the slow DNS lookups.
debian:~# cat /etc/apt/sources.list
deb cdrom:[Debian GNU/Linux 4.0 r0 _Etch_ - Official amd64 DVD
Binary-1 20070407-12:15]/ etch contrib main
You should add on lines after that lines that point to your mirror of
deb http://ftp3.nrc.ca/debian/ etch main contrib non-free
deb http://security.debian.org/ etch/updates main contrib non-free
This ensures that you get the most up-to-date packages within Etch
(stable).
deb http://debian-multimedia.org etch main
deb http://volatile.debian.org/debian-volatile etch/volatile main \
contrib non-free
I've added these lines and downloaded the latest updates. Still I
have incredibly slow DNS lookups. Like I mentioned earlier, this is
definitely not happening in Windows Vista which runs on the same
machine from a different drive/partition.

Once the DNS lookup completes, things seem pretty fast. I'm not sure
where else to look at this point.
Kushal Kumaran
2007-05-12 08:26:07 UTC
Permalink
Post by Dallas Clement
Post by Douglas Allan Tutty
Post by Dallas Clement
Post by Douglas Allan Tutty
Post by Dallas Clement
I'm getting terrible DNS lookup performance on my Debian Etch system.
I've installed the "Etch" - Official Beta amd64 version.
What is an official beta of Etch which is the current Stable?
Sadly, after upgrading to 4.0 r0 I am still experiencing the slow DNS lookups.
debian:~# cat /etc/apt/sources.list
deb cdrom:[Debian GNU/Linux 4.0 r0 _Etch_ - Official amd64 DVD
Binary-1 20070407-12:15]/ etch contrib main
You should add on lines after that lines that point to your mirror of
deb http://ftp3.nrc.ca/debian/ etch main contrib non-free
deb http://security.debian.org/ etch/updates main contrib non-free
This ensures that you get the most up-to-date packages within Etch
(stable).
deb http://debian-multimedia.org etch main
deb http://volatile.debian.org/debian-volatile etch/volatile main \
contrib non-free
I've added these lines and downloaded the latest updates. Still I
have incredibly slow DNS lookups. Like I mentioned earlier, this is
definitely not happening in Windows Vista which runs on the same
machine from a different drive/partition.
Once the DNS lookup completes, things seem pretty fast. I'm not sure
where else to look at this point.
This is not really a solution, just a workaround, but have you tried
installing a local DNS cache? pdnsd requires no configuration to set
up.
--
Kushal
Dallas Clement
2007-05-12 14:07:58 UTC
Permalink
Post by Kushal Kumaran
Post by Dallas Clement
Post by Douglas Allan Tutty
Post by Dallas Clement
Post by Douglas Allan Tutty
Post by Dallas Clement
I'm getting terrible DNS lookup performance on my Debian Etch system.
I've installed the "Etch" - Official Beta amd64 version.
What is an official beta of Etch which is the current Stable?
Sadly, after upgrading to 4.0 r0 I am still experiencing the slow DNS lookups.
debian:~# cat /etc/apt/sources.list
deb cdrom:[Debian GNU/Linux 4.0 r0 _Etch_ - Official amd64 DVD
Binary-1 20070407-12:15]/ etch contrib main
You should add on lines after that lines that point to your mirror of
deb http://ftp3.nrc.ca/debian/ etch main contrib non-free
deb http://security.debian.org/ etch/updates main contrib non-free
This ensures that you get the most up-to-date packages within Etch
(stable).
deb http://debian-multimedia.org etch main
deb http://volatile.debian.org/debian-volatile etch/volatile main \
contrib non-free
I've added these lines and downloaded the latest updates. Still I
have incredibly slow DNS lookups. Like I mentioned earlier, this is
definitely not happening in Windows Vista which runs on the same
machine from a different drive/partition.
Once the DNS lookup completes, things seem pretty fast. I'm not sure
where else to look at this point.
This is not really a solution, just a workaround, but have you tried
installing a local DNS cache? pdnsd requires no configuration to set
up.
--
Kushal
No I sure haven't, but that's probably a good thing to do anyway. I
think we are narrowing in on the problem as something to do with DNS
relay through my local router. Doing a time dig on the actual ISP DNS
address was extremely fast.
Thilo Six
2007-05-12 17:52:21 UTC
Permalink
Kushal Kumaran wrote the following on 12.05.2007 10:26:

<snip>
Post by Kushal Kumaran
This is not really a solution, just a workaround, but have you tried
installing a local DNS cache? pdnsd requires no configuration to set
up.
pdnsd is neat. thanks.

bye Thilo
--
i am on Ubuntu 2.6 KDE
- some friend of mine

gpg key: 0x4A411E09
Karl E. Jorgensen
2007-05-12 13:27:22 UTC
Permalink
Post by Dallas Clement
I'm getting terrible DNS lookup performance on my Debian Etch system.
I've installed the "Etch" - Official Beta amd64 version.
After installing, I noticed that the Internet browsers were taking a
really long time to pull up a web page. I also observed that the
browser delays seemed to be DNS related as they were spending a lot of
time "Looking up whatever.com...".
I turned off IPv6 and it made no observable difference.
How?
Post by Dallas Clement
It seems that a DNS lookup is taking 10s on average. Here is the dig
debian:/# time dig 192.168.0.1 www.yahoo.com
[snip]
Post by Dallas Clement
;; Query time: 10 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Thu May 10 09:39:21 2007
;; MSG SIZE rcvd: 104
; <<>> DiG 9.3.4 <<>> 192.168.0.1 www.yahoo.com
;; global options: printcmd
[snip]
Post by Dallas Clement
;; Query time: 10 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Thu May 10 09:39:26 2007
;; MSG SIZE rcvd: 368
real 0m10.031s
user 0m0.000s
sys 0m0.000s
Weird - the elapsed time for the DNS queries are reported as 10 msec
each, yet they are 5 seconds apart?
Post by Dallas Clement
This very same machine also has Windows Vista Ultimate 64 installed on
it and DNS lookups are lightning fast. There is definitely something
going on with Debian Etch or perhaps the network configuration.
Does the other OS use the same DNS server(s)?

The contents of /etc/resolv.conf might provide clues - especially if
compared to the Windows equivalent (of which I know nothing...)
Post by Dallas Clement
I am using the ndiswrapper around a Windows driver for my Broadcom
wireless network adapter.
Shouldn't matter, assuming that you don't have any other network
problems...
--
Karl E. Jorgensen
***@jorgensen.org.uk http://www.jorgensen.org.uk/
***@jorgensen.com http://karl.jorgensen.com
==== Today's fortune:
Learning French is trivial: the word for horse is cheval, and everything else
follows in the same way.
-- Alan J. Perlis
Dallas Clement
2007-05-12 14:03:41 UTC
Permalink
Post by Karl E. Jorgensen
Post by Dallas Clement
I'm getting terrible DNS lookup performance on my Debian Etch system.
I've installed the "Etch" - Official Beta amd64 version.
After installing, I noticed that the Internet browsers were taking a
really long time to pull up a web page. I also observed that the
browser delays seemed to be DNS related as they were spending a lot of
time "Looking up whatever.com...".
I turned off IPv6 and it made no observable difference.
How?
Post by Dallas Clement
It seems that a DNS lookup is taking 10s on average. Here is the dig
debian:/# time dig 192.168.0.1 www.yahoo.com
[snip]
Post by Dallas Clement
;; Query time: 10 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Thu May 10 09:39:21 2007
;; MSG SIZE rcvd: 104
; <<>> DiG 9.3.4 <<>> 192.168.0.1 www.yahoo.com
;; global options: printcmd
[snip]
Post by Dallas Clement
;; Query time: 10 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Thu May 10 09:39:26 2007
;; MSG SIZE rcvd: 368
real 0m10.031s
user 0m0.000s
sys 0m0.000s
Weird - the elapsed time for the DNS queries are reported as 10 msec
each, yet they are 5 seconds apart?
Post by Dallas Clement
This very same machine also has Windows Vista Ultimate 64 installed on
it and DNS lookups are lightning fast. There is definitely something
going on with Debian Etch or perhaps the network configuration.
Does the other OS use the same DNS server(s)?
The contents of /etc/resolv.conf might provide clues - especially if
compared to the Windows equivalent (of which I know nothing...)
Post by Dallas Clement
I am using the ndiswrapper around a Windows driver for my Broadcom
wireless network adapter.
Shouldn't matter, assuming that you don't have any other network
problems...
This is what's in my /etc/resolv.conf:

***@debian:~$ cat /etc/resolv.conf
search clements
nameserver 192.168.0.1

'clements is the name of the local domain. And that is the correct name
server on the local domain which happens to be a D-link router. It uses
DNS relay to forward DNS requests to my ISP.

Interestingly, if I repeat the dig test directly on my ISP DNS server
address, the time between queries is dramatically reduced:

----------------------------------------------------------
debian:/home/dallas# time dig 151.164.20.201 debian.org
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 59962
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;151.164.20.201. IN A

;; AUTHORITY SECTION:
. 10667 IN SOA A.ROOT-SERVERS.NET.
NSTLD.VERISIGN-GRS.COM. 2007051101 1800 900 604800 86400

;; Query time: 9 msec
;; SERVER: 151.164.20.201#53(151.164.20.201)
;; WHEN: Sat May 12 08:55:23 2007
;; MSG SIZE rcvd: 107


; <<>> DiG 9.3.4 <<>> 151.164.20.201 debian.org
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42634
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 0

;; QUESTION SECTION:
;debian.org. IN A

;; ANSWER SECTION:
debian.org. 3600 IN A 192.25.206.10

;; AUTHORITY SECTION:
debian.org. 2615 IN NS rietz.debian.org.
debian.org. 2615 IN NS klecker.debian.org.
debian.org. 2615 IN NS raff.debian.org.

;; Query time: 138 msec
;; SERVER: 151.164.20.201#53(151.164.20.201)
;; WHEN: Sat May 12 08:55:24 2007
;; MSG SIZE rcvd: 105


real 0m0.157s
user 0m0.004s
sys 0m0.000s

----------------------------------------------------------

WOW! And if I directly edit the /etc/resolv.conf and put in the DNS
server address of my ISP instead of my relaying D-Link router, lo and
behold, my web-browsing is incredibly fast!!! I think we can safely
conclude that the problem lies with my router and slow DNS relay.
Though I must say that I am a bit mystified as to why Windows is so fast
if it presumably relies on the D-link router for DNS relay also.

I wish there was a way to keep my ISP DNS addresses in
the /etc/resolv.conf file permanently. I think they get overwritten
after getting a DHCP response.

Thanks for the help.
Douglas Allan Tutty
2007-05-12 14:40:28 UTC
Permalink
Post by Dallas Clement
Post by Dallas Clement
I'm getting terrible DNS lookup performance on my Debian Etch system.
Interestingly, if I repeat the dig test directly on my ISP DNS server
debian:/home/dallas# time dig 151.164.20.201 debian.org
;151.164.20.201. IN A
----------------------------------------------------------
WOW! And if I directly edit the /etc/resolv.conf and put in the DNS
server address of my ISP instead of my relaying D-Link router, lo and
behold, my web-browsing is incredibly fast!!! I think we can safely
conclude that the problem lies with my router and slow DNS relay.
Though I must say that I am a bit mystified as to why Windows is so fast
if it presumably relies on the D-link router for DNS relay also.
I wish there was a way to keep my ISP DNS addresses in
the /etc/resolv.conf file permanently. I think they get overwritten
after getting a DHCP response.
Never having used a router that I didn't make, can you write a script
that queries the router for the server address of the ISP and changes
/etc/resolv.conf? For example, what is the hostname that matches the
ISP's dns server? While the ip number may change, the hostname may not.
Perhaps you can use the router to get you the IP of the DNS server and
then use that from then on, until the DHCP is renegotiated.

Doug.
Dallas Clement
2007-05-12 17:41:32 UTC
Permalink
Post by Douglas Allan Tutty
Post by Dallas Clement
Post by Dallas Clement
I'm getting terrible DNS lookup performance on my Debian Etch system.
Interestingly, if I repeat the dig test directly on my ISP DNS server
debian:/home/dallas# time dig 151.164.20.201 debian.org
;151.164.20.201. IN A
----------------------------------------------------------
WOW! And if I directly edit the /etc/resolv.conf and put in the DNS
server address of my ISP instead of my relaying D-Link router, lo and
behold, my web-browsing is incredibly fast!!! I think we can safely
conclude that the problem lies with my router and slow DNS relay.
Though I must say that I am a bit mystified as to why Windows is so fast
if it presumably relies on the D-link router for DNS relay also.
I wish there was a way to keep my ISP DNS addresses in
the /etc/resolv.conf file permanently. I think they get overwritten
after getting a DHCP response.
Never having used a router that I didn't make, can you write a script
that queries the router for the server address of the ISP and changes
/etc/resolv.conf? For example, what is the hostname that matches the
ISP's dns server? While the ip number may change, the hostname may not.
Perhaps you can use the router to get you the IP of the DNS server and
then use that from then on, until the DHCP is renegotiated.
Doug.
I may have to resort to this if I can't get resolve it in a more natural
way. I have all the information that is needed.

Thanks for the idea.
Karl E. Jorgensen
2007-05-12 15:15:59 UTC
Permalink
Post by Dallas Clement
Post by Dallas Clement
I'm getting terrible DNS lookup performance on my Debian Etch system.
I've installed the "Etch" - Official Beta amd64 version.
After installing, I noticed that the Internet browsers were taking a
really long time to pull up a web page. I also observed that the
browser delays seemed to be DNS related as they were spending a lot of
time "Looking up whatever.com...".
[snip]
Post by Dallas Clement
search clements
nameserver 192.168.0.1
'clements is the name of the local domain. And that is the correct name
server on the local domain which happens to be a D-link router. It uses
DNS relay to forward DNS requests to my ISP.
Interestingly, if I repeat the dig test directly on my ISP DNS server
[snip]
Post by Dallas Clement
real 0m0.157s
user 0m0.004s
sys 0m0.000s
WOW! And if I directly edit the /etc/resolv.conf and put in the DNS
server address of my ISP instead of my relaying D-Link router, lo and
behold, my web-browsing is incredibly fast!!! I think we can safely
conclude that the problem lies with my router and slow DNS relay.
Though I must say that I am a bit mystified as to why Windows is so fast
if it presumably relies on the D-link router for DNS relay also.
"presumably" - I suspect not. At least that would make for a natural
explanation...

Another possible explanation: Do you have a firewall on the linux box?
If so, try disabling it. My rationale? If the firewall gets in the way
of udp:53 but not tcp:53, I'd expect the same 5-second delay, as the
resolver first tries udp and then falls back on tcp... (perhaps windows
"remembers" that udp failed and then plods on with tcp?)

It might be worth double-checking the firewall settings on the router.
Sounds like they're OK, but a quick browse is in order...
Post by Dallas Clement
I wish there was a way to keep my ISP DNS addresses in
the /etc/resolv.conf file permanently. I think they get overwritten
after getting a DHCP response.
Can't the router be reconfigured?
Post by Dallas Clement
Thanks for the help.
No problem
--
Karl E. Jorgensen
***@jorgensen.org.uk http://www.jorgensen.org.uk/
***@jorgensen.com http://karl.jorgensen.com
==== Today's fortune:
The more crap you put up with, the more crap you are going to get.
Dallas Clement
2007-05-12 17:35:49 UTC
Permalink
Post by Karl E. Jorgensen
Post by Dallas Clement
Post by Dallas Clement
I'm getting terrible DNS lookup performance on my Debian Etch system.
I've installed the "Etch" - Official Beta amd64 version.
After installing, I noticed that the Internet browsers were taking a
really long time to pull up a web page. I also observed that the
browser delays seemed to be DNS related as they were spending a lot of
time "Looking up whatever.com...".
[snip]
Post by Dallas Clement
search clements
nameserver 192.168.0.1
'clements is the name of the local domain. And that is the correct name
server on the local domain which happens to be a D-link router. It uses
DNS relay to forward DNS requests to my ISP.
Interestingly, if I repeat the dig test directly on my ISP DNS server
[snip]
Post by Dallas Clement
real 0m0.157s
user 0m0.004s
sys 0m0.000s
WOW! And if I directly edit the /etc/resolv.conf and put in the DNS
server address of my ISP instead of my relaying D-Link router, lo and
behold, my web-browsing is incredibly fast!!! I think we can safely
conclude that the problem lies with my router and slow DNS relay.
Though I must say that I am a bit mystified as to why Windows is so fast
if it presumably relies on the D-link router for DNS relay also.
"presumably" - I suspect not. At least that would make for a natural
explanation...
Another possible explanation: Do you have a firewall on the linux box?
If so, try disabling it. My rationale? If the firewall gets in the way
of udp:53 but not tcp:53, I'd expect the same 5-second delay, as the
resolver first tries udp and then falls back on tcp... (perhaps windows
"remembers" that udp failed and then plods on with tcp?)
It might be worth double-checking the firewall settings on the router.
Sounds like they're OK, but a quick browse is in order...
Post by Dallas Clement
I wish there was a way to keep my ISP DNS addresses in
the /etc/resolv.conf file permanently. I think they get overwritten
after getting a DHCP response.
Can't the router be reconfigured?
Sadly, my router is pretty inflexible in terms of the DNS configuration.
It mandates the use of DNS relay.

I don't think I have any firewall enabled on the linux box. At least I
don't see any and I didn't deliberately turn one one after the new
install.

I do have a firewall turned on in my D-link router though. It is only
allowing HTTP, FTP, POP3, and SMTP traffic through to a different host
on my LAN.

Do I need to open up port 53 to my linux box then?
Loading...