You are not logged in.

#1 2009-06-02 04:19:40

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

[solved]Slow dns lookup from terminal -- normal speed in firefox ???

Strange problem for last few weeks. DNS lookups while in terminal are very slow (e.g. pacman has a normal download speed, but pauses in between each download, and it takes forever for yaourt to check each AUR package, and elinks even has long pauses anytime you go to a new address). Firefox browses normally -- even to brand new sites that aren't cached. Download speeds are normal -- it's just the lookup time. I had the same issue in firefox, too until I globally disabled IPv6 per the wiki (modprobe.conf entry).

I just don't get why it would be different between firefox and terminal (both virtual terminals and urxvt respond the same way) !

/etc/hosts:
127.0.0.1               scotty.localdomain      localhost scotty
192.168.1.100   mediacenter
192.168.1.101   homeserver
192.168.1.102   familyroom
192.168.1.1     router
/etc/network.d/profile
CONNECTION="wireless"
ESSID="firecat4153"
INTERFACE="wlan0"
DESCRIPTION="Automatically generated profile"
IWCONFIG="rate 54M mode managed"
SCAN="yes"
IP="static"
IFOPTS="192.168.1.104 netmask 255.255.255.0 broadcast 192.168.1.255"
GATEWAY="192.168.1.1"
DNS1="192.168.1.1"
TIMEOUT="10"
SECURITY="wpa"
KEY="key"
route -n
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     0      0        0 wlan0
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 wlan0
 /etc/resolv.conf
nameserver 192.168.1.1

Let me know if I can provide any other info for troubleshooting.

Thanks!
Scott

Last edited by firecat53 (2009-06-05 03:37:24)

Offline

#2 2009-06-02 05:16:50

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: [solved]Slow dns lookup from terminal -- normal speed in firefox ???

dig google.com
dig google.com @192.168.1.1

Offline

#3 2009-06-02 11:40:01

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: [solved]Slow dns lookup from terminal -- normal speed in firefox ???

ftp.archlinux.org gets pretty busy and queries go through there?


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#4 2009-06-02 15:43:57

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: [solved]Slow dns lookup from terminal -- normal speed in firefox ???

Highly unlikely, but make sure that you're not using a proxy (which would explain the slowness):

echo $http_proxy

Offline

#5 2009-06-02 17:04:48

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [solved]Slow dns lookup from terminal -- normal speed in firefox ???

Well, it appears its a problem with my router -- I'm not sure what yet. I went to work today and the wireless connection at work connects perfectly both through the terminal and firefox. All the lookups are apparently normal and speedy! I did check $HTTP_PROXY and $htttp_proxy, both are null. I will have to get home before I try the dig commands -- it all works great here! If it is my router, what the heck could cause that difference?? Oh well, I'll try it tomorrow and see what pops up.

Thanks,
Scott

Offline

#6 2009-06-04 17:32:38

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [solved]Slow dns lookup from terminal -- normal speed in firefox ???

dig google.com
dig google.com@192.168.1.1

[firecat53@scotty ~]$ dig google.com

; <<>> DiG 9.6.0-P1 <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16711
;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

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

;; ANSWER SECTION:
google.com.             240     IN      A       74.125.67.100

;; Query time: 36 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Thu Jun  4 10:31:15 2009
;; MSG SIZE  rcvd: 54

[firecat53@scotty ~]$ dig google.com @192.168.1.1

; <<>> DiG 9.6.0-P1 <<>> google.com @192.168.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7066
;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

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

;; ANSWER SECTION:
google.com.             240     IN      A       74.125.67.100

;; Query time: 7 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Thu Jun  4 10:31:25 2009
;; MSG SIZE  rcvd: 54

Does that shed any light? I'm not much of networking guru.

This is baffling me!! I don't understand why there would be a difference between internet from terminal and internet from a gui browser!! Anyone have any brilliant insights?? Please??

Thanks!
Scott

Last edited by firecat53 (2009-06-04 17:34:38)

Offline

#7 2009-06-04 23:18:36

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: [solved]Slow dns lookup from terminal -- normal speed in firefox ???

WARNING: recursion requested but not available

Something is not quite right -- your router should be happy to offer you recursion. It says that it won't, but then it does (by resolving Google for you)

This could be part of your problem. Is this an off-the-shelf product, or a home-built firewall/router?

Last edited by fukawi2 (2009-06-04 23:19:16)

Offline

#8 2009-06-05 01:40:25

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [solved]Slow dns lookup from terminal -- normal speed in firefox ???

Well, I've done some more testing:
Ubuntu, mint and arch (about 3 or 4 months old larch usb flash drive) booted on this computer all work perfectly. 'elinks google.com' brings it up almost instantly, aptitude and pacman updates hook up immediately to the servers. 'elinks google.com' right now (64 bit arch - all up to date) takes almost 10 seconds to resolve the hostname, pacman and wget take 5-10 sec to start a download.

I have two other arch32 machines in the house, and they both also are experiencing this lag from the command line. But again, firefox browsing works great -- no lag.

@fakawi2 - the router is a linksys wrt54-G2. And now given that other distros seem to work fine, I'm thinking it's not the router. But then my laptop worked fine on a different network!!

Thanks,
Scott

Offline

#9 2009-06-05 03:03:40

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: [solved]Slow dns lookup from terminal -- normal speed in firefox ???

if you have any zeroconf or samba crap (wins) going on, it could be screwing things up (upnp on your router)

http://bbs.archlinux.org/viewtopic.php?id=58712

anyway, try some of the solutions posted there and see if any help.

Last edited by cactus (2009-06-05 03:05:14)


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#10 2009-06-05 03:36:39

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [solved]Slow dns lookup from terminal -- normal speed in firefox ???

Well, I think I solved it, although I don't quite understand....
With my old Dlink router, my resolv.conf just had the router as the nameserver (nameserver 192.168.0.1).
With this new WRT54G2 router, that seems to not work, and the resolv.conf needs to have actual DNS servers (I use the Open DNS servers) in it. Just having the 192.168.1.1 address seems to be the problem. That's why when I connected with Wicd or network manager or even using automatic DHCP instead of the static IP I'm using now, that it would work properly, because the resolv.conf would be updated automatically with the other DNS servers.

Anyway, all better now. Although feel free to chime in if you can explain why this would affect the terminal but firefox worked fine smile

Thanks!
Scott

Last edited by firecat53 (2009-06-05 03:49:40)

Offline

#11 2009-06-06 21:45:23

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: [solved]Slow dns lookup from terminal -- normal speed in firefox ???

Yeah think this relates to the new dhcpcd?  Before the update I too just used '208.67.222.222' for example and it did fine.  Prepending that with nameserver fixed it.


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

Board footer

Powered by FluxBB