LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-14-2010, 06:44 PM   #1
-Dice
Member
 
Registered: Oct 2003
Location: Michigan
Distribution: Debian
Posts: 53

Rep: Reputation: 15
slow dns resolution


Hi everyone,

I'm running Ubuntu 9.10 and experiencing slow DNS resolution over a wired connection, even running a vanilla kernel without ipv6 capability. I've disabled ipv6 in firefox, changed my DNS servers (tried 4.2.2.1 and OpenDNS), upgraded to beta Tomato firmware for my linksys router, tried disabling the nonexistent ipv6 modules, tried pdnsd, all to no avail. Anyone else have any other suggestions? DNS resolution is fine when the computer is either connected directly to the modem or in Windows 7. Also, my 9.10 laptop works fine with wireless on the same router. Any help would be appreciated
 
Old 02-14-2010, 07:37 PM   #2
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Quote:
Originally Posted by -Dice View Post
Hi everyone,

I'm running Ubuntu 9.10 and experiencing slow DNS resolution over a wired connection...

... DNS resolution is fine when the computer is either connected directly to the modem
What do you mean by "wired connection" and "Connected directly"?

Thanks
 
Old 02-14-2010, 07:45 PM   #3
-Dice
Member
 
Registered: Oct 2003
Location: Michigan
Distribution: Debian
Posts: 53

Original Poster
Rep: Reputation: 15
"wired" as opposed to wireless, so using an ethernet cable I guess. By "connected directly" I mean bypassing my router and connecting directly to my cable modem.
 
Old 02-15-2010, 03:19 AM   #4
Choon Keat
LQ Newbie
 
Registered: Feb 2010
Location: Singapore
Posts: 3

Rep: Reputation: 0
Mind Posting your resolv.conf and your traceroute to each of the dns servers
 
Old 02-16-2010, 05:11 PM   #5
tanvir1
LQ Newbie
 
Registered: Apr 2009
Location: Canberra, Australia
Posts: 7

Rep: Reputation: Disabled
Quote:
Originally Posted by -Dice View Post
"wired" as opposed to wireless, so using an ethernet cable I guess. By "connected directly" I mean bypassing my router and connecting directly to my cable modem.
Check if your router is shaping packets.
 
Old 02-16-2010, 05:16 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
In what way is it slow? What does a tcpdump of a single DNS resolution look like? Is it retrying? Trying different servers? What are you actually doing to pinpoint a DNS issue in the first place? host/dig/nslookup i would hope.
 
Old 02-16-2010, 09:27 PM   #7
devwatchdog
Member
 
Registered: Jan 2010
Posts: 202

Rep: Reputation: 47
Dice, you can use 'host -a' to see the time involved with resolving a name, which shows up at the bottom of the results.

Code:
jcwx@haley:~$ host -a google.com 24.196.64.53
Trying "google.com"
Using domain server:
Name: 24.196.64.53
Address: 24.196.64.53#53
Aliases: 

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52127
;; flags: qr rd ra; QUERY: 1, ANSWER: 14, AUTHORITY: 4, ADDITIONAL: 7

;; QUESTION SECTION:
;google.com.			IN	ANY

;; ANSWER SECTION:
google.com.		247	IN	MX	400 google.com.s9b2.psmtp.com.
google.com.		247	IN	MX	100 google.com.s9a1.psmtp.com.
google.com.		247	IN	MX	200 google.com.s9a2.psmtp.com.
google.com.		247	IN	MX	300 google.com.s9b1.psmtp.com.
google.com.		216	IN	A	74.125.95.104
google.com.		216	IN	A	74.125.95.105
google.com.		216	IN	A	74.125.95.106
google.com.		216	IN	A	74.125.95.147
google.com.		216	IN	A	74.125.95.99
google.com.		216	IN	A	74.125.95.103
google.com.		231122	IN	NS	ns4.google.com.
google.com.		231122	IN	NS	ns2.google.com.
google.com.		231122	IN	NS	ns3.google.com.
google.com.		231122	IN	NS	ns1.google.com.

;; AUTHORITY SECTION:
google.com.		231122	IN	NS	ns4.google.com.
google.com.		231122	IN	NS	ns1.google.com.
google.com.		231122	IN	NS	ns3.google.com.
google.com.		231122	IN	NS	ns2.google.com.

;; ADDITIONAL SECTION:
google.com.s9a1.psmtp.com. 13160 IN	A	74.125.148.10
google.com.s9a2.psmtp.com. 8574	IN	A	74.125.148.11
google.com.s9b1.psmtp.com. 3929	IN	A	74.125.148.13
google.com.s9b2.psmtp.com. 1587	IN	A	74.125.148.14
ns1.google.com.		36325	IN	A	216.239.32.10
ns2.google.com.		33786	IN	A	216.239.34.10
ns3.google.com.		54712	IN	A	216.239.36.10

Received 498 bytes from 24.196.64.53#53 in 25 ms
jcwx@haley:~$
The 24.196.64.53 address at the end of the command is a DNS server. You can leave that off and whatever is defined in resolv.conf will be used. That should allow you to quantify the delays you are experiencing. You might try this on your firewall/router as well, although I'm using OpenWRT, and the host command isn't installed. Your firmware might have it.

If you firewall is resolving well, you might consider setting up dnsmasq on it. It works well on OpenWRT. In reality, though, you really shouldn't be having any issues with DNS like you describe. You could run a tcpdump capture to see the traffic itself. Could provide a clue as to what is going on:

tcpdump -s 0 -vvvnni eth1 port 53 or icmp

Replace the interface with whatever applies in your situation. You can run that on your firewall as well as your local system. The icmp could provide messages indicating there is a network related problem.

I was looking at nslookup, and there is a debug mode that could provide some insight into potential DNS issues. dig has plenty of command line options, too.

Code:
jcwx@haley:~$ nslookup
> set debug
> set d2
> slackware.com
addlookup()
make_empty_lookup()
looking up slackware.com
start_lookup()
setup_lookup(0x272de00)
resetting lookup counter.

(cut for the sake of brevity)

------------
detailsection()
    QUESTIONS:
	slackware.com, type = A, class = IN
detailsection()
    ANSWERS:
    ->  slackware.com
	internet address = 64.57.102.34
detailsection()
    AUTHORITY RECORDS:
detailsection()
    ADDITIONAL RECORDS:
------------
Non-authoritative answer:
printsection()
Name:	slackware.com
Address: 64.57.102.34
still pending.
cancel_lookup()
check_if_done()
list empty
clear_query(0xb76b8010)
sockcount=0
check_next_lookup(0x272de00)
try_clear_lookup(0x272de00)
destroy
freeing server 0x271b200 belonging to 0x272de00
start_lookup()
check_if_done()
list empty
shutting down
dighost_shutdown()
unlock_lookup dighost.c:3315
>
Could help. Good luck.

Last edited by devwatchdog; 02-16-2010 at 09:51 PM.
 
Old 02-17-2010, 04:31 PM   #8
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,008

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
I add in my home router's IP as a dns server too along with the ISP's. It seems to help.
 
Old 04-12-2010, 07:08 PM   #9
-Dice
Member
 
Registered: Oct 2003
Location: Michigan
Distribution: Debian
Posts: 53

Original Poster
Rep: Reputation: 15
I'm so sorry LQ, I was out of the country for a while and then forgot to check the responses to this thread. Unfortunately my computer is still symptomatic: it's slow to load web pages in firefox and opera. It can handle sustained connections for gaming and such with no problems besides an initial pause.

Confusingly, DNS resolution is very fast using dig/nslookup/host. I still have no problems on the same machine with Windows 7. I assumed that I had a DNS issue because of other Ubuntu threads and also firefox's status bar message, "Looking up (site)..."

resolv.conf:
# Generated by NetworkManager
nameserver 192.168.1.1
nameserver 4.2.2.2

Looking at tcpdump on port 53 while entering a site into opera, I noticed that it takes a long time (10-15 seconds) for any traffic to show up, but once it does the page loads quickly. Any thoughts?
 
Old 04-12-2010, 07:20 PM   #10
-Dice
Member
 
Registered: Oct 2003
Location: Michigan
Distribution: Debian
Posts: 53

Original Poster
Rep: Reputation: 15
I get the following upon entering "bash.org" into opera:

192.168.1.200.55658 > 192.168.1.1.53: [bad udp cksum ba81!] 63129+ A? bash.org. (26)
20:18:56.625352 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 70)
192.168.1.1.53 > 192.168.1.200.55658: [udp sum ok] 63129 q: A? bash.org. 1/0/0 bash.org. [26m33s] A 69.61.106.93 (42)
20:19:03.623328 IP (tos 0x0, ttl 64, id 27071, offset 0, flags [DF], proto UDP (17), length 68)
 
Old 04-15-2010, 11:25 AM   #11
-Dice
Member
 
Registered: Oct 2003
Location: Michigan
Distribution: Debian
Posts: 53

Original Poster
Rep: Reputation: 15
any thoughts?
 
Old 04-15-2010, 11:38 AM   #12
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by -Dice View Post
any thoughts?
If dig/nslookup/host are very fast but Opera and Firefox are not (as shown by "Looking up (site)..." and tcpdump then Opera and Firefox are probably using different name resolution methods from dig/nslookup/host.

Not something I know a lot about so I can't help much further but hopefully the pointer is some help.

Might be worth posting your nsswtch.conf (but dig/nslookup/host probably use that so it may not help) -- elsewise time to investigate how the browsers are configured to do name resolution.
 
Old 04-16-2010, 05:49 AM   #13
cola
Senior Member
 
Registered: Sep 2007
Posts: 1,045

Rep: Reputation: 65
Quote:
Originally Posted by -Dice View Post
any thoughts?
Post:
Code:
ifconfig -a
route -n
cat /etc/resolv.conf
 
Old 04-16-2010, 11:16 AM   #14
-Dice
Member
 
Registered: Oct 2003
Location: Michigan
Distribution: Debian
Posts: 53

Original Poster
Rep: Reputation: 15
ifconfig -a
eth0 Link encap:Ethernet HWaddr
inet addr:192.168.1.200 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10028920 errors:0 dropped:0 overruns:0 frame:0
TX packets:9701624 errors:0 dropped:0 overruns:0 carrier:2
collisions:0 txqueuelen:1000
RX bytes:4065667133 (4.0 GB) TX bytes:1024833837 (1.0 GB)
Interrupt:30

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:3343984 errors:0 dropped:0 overruns:0 frame:0
TX packets:3343984 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1403095499 (1.4 GB) TX bytes:1403095499 (1.4 GB)

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0

resolv.conf:
# Generated by NetworkManager
nameserver 192.168.1.1
nameserver 4.2.2.2
 
Old 04-16-2010, 11:17 AM   #15
-Dice
Member
 
Registered: Oct 2003
Location: Michigan
Distribution: Debian
Posts: 53

Original Poster
Rep: Reputation: 15
nsswitch.conf
passwd: compat
group: compat
shadow: compat

hosts: files mdns4_minimal [NOTFOUND=return] wins dns mdns4
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: nis
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
slow DNS resolution in Ubuntu septanla Linux - Networking 7 05-11-2009 05:40 PM
slow to boot, slow dns resolution after host name change FC5 edavis6678 Linux - Newbie 3 01-03-2007 06:26 PM
dns resolution exceedingly slow greeklegend Linux - Networking 2 10-19-2006 03:23 AM
Slow DNS Resolution intargc Slackware 1 01-12-2006 12:56 PM
DNS Name Resolution Slow on Internet mooreted Linux - Networking 3 12-25-2003 02:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration