You are not logged in.

#1 2008-11-10 00:26:17

Sharpeee
Member
From: Denmark
Registered: 2008-10-19
Posts: 59

[SOLVED] Slow DNS lookup, I think

Hi

I have a really annoying problem. My DNS lookup in Arch is painfully slow. I know it's not a network problem, as I don't have any problems in my Ubuntu installation. I have tried to run two simple tests to show you what I mean. The first is a simple ping google.

########### Ubuntu ###########
carsten@carsten-laptop:~$ time ping -c 3 www.google.com
PING www.l.google.com (216.239.61.104) 56(84) bytes of data.
64 bytes from sn-in-f104.google.com (216.239.61.104): icmp_seq=1 ttl=245 time=17.4 ms
64 bytes from sn-in-f104.google.com (216.239.61.104): icmp_seq=2 ttl=245 time=20.6 ms
64 bytes from sn-in-f104.google.com (216.239.61.104): icmp_seq=3 ttl=245 time=11.4 ms

--- www.l.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 11.465/16.529/20.641/3.809 ms

real    0m2.290s
user    0m0.000s
sys    0m0.004s


########### Arch ###########
carsten ~/Desktop $  time ping -c 3 www.google.com
PING www.l.google.com (216.239.61.104) 56(84) bytes of data.
64 bytes from sn-in-f104.google.com (216.239.61.104): icmp_seq=1 ttl=245 time=12.3 ms
64 bytes from sn-in-f104.google.com (216.239.61.104): icmp_seq=2 ttl=245 time=10.7 ms
64 bytes from sn-in-f104.google.com (216.239.61.104): icmp_seq=3 ttl=245 time=12.4 ms

--- www.l.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2007ms
rtt min/avg/max/mdev = 10.776/11.867/12.476/0.778 ms

real    0m15.305s
user    0m0.013s
sys    0m0.007s

Ubuntu: 0m2.290s vs. Arch: 0m15.305s.

In the second test I tried to fake a pacman update by downloading the .db files from my primary server. On both Ubuntu and Arch I used this simple script

repos=( core extra community )

time for repo in ${repos[@]}
do
    wget http://archlinux.unixheads.org/$repo/os/i686/$repo.db.tar.gz
done

When I run it in, I get this result

########### Ubuntu ###########
carsten@carsten-laptop:~/Desktop$ ./updatetest
--2008-11-10 07:58:23--  http://archlinux.unixheads.org/core/os/i686/core.db.tar.gz
Resolving archlinux.unixheads.org... 204.152.186.174
Connecting to archlinux.unixheads.org|204.152.186.174|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 32515 (32K) [application/x-gzip]
Saving to: `core.db.tar.gz'

100%[=============================================================>] 32.515      --.-K/s   in 0,1s    

2008-11-10 07:58:23 (331 KB/s) - `core.db.tar.gz' saved [32515/32515]

--2008-11-10 07:58:23--  http://archlinux.unixheads.org/extra/os/i686/extra.db.tar.gz
Resolving archlinux.unixheads.org... 204.152.186.174
Connecting to archlinux.unixheads.org|204.152.186.174|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 422622 (413K) [application/x-gzip]
Saving to: `extra.db.tar.gz'

100%[=============================================================>] 422.622      242K/s   in 1,7s    

2008-11-10 07:58:25 (242 KB/s) - `extra.db.tar.gz' saved [422622/422622]

--2008-11-10 07:58:25--  http://archlinux.unixheads.org/community/os/i686/community.db.tar.gz
Resolving archlinux.unixheads.org... 204.152.186.174
Connecting to archlinux.unixheads.org|204.152.186.174|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 369845 (361K) [application/x-gzip]
Saving to: `community.db.tar.gz'

100%[=============================================================>] 369.845      206K/s   in 1,8s    

2008-11-10 07:58:27 (206 KB/s) - `community.db.tar.gz' saved [369845/369845]


real    0m3.837s
user    0m0.016s
sys    0m0.036s


########### Arch ###########
carsten ~/Desktop $  ./updatetest 
--2008-11-10 08:01:33--  http://archlinux.unixheads.org/core/os/i686/core.db.tar.gz
Resolving archlinux.unixheads.org... 204.152.186.174
Connecting to archlinux.unixheads.org|204.152.186.174|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 32515 (32K) [application/x-gzip]
Saving to: `core.db.tar.gz'

100%[==============================================================================>] 32,515      --.-K/s   in 0.1s    

2008-11-10 08:01:47 (303 KB/s) - `core.db.tar.gz' saved [32515/32515]

--2008-11-10 08:01:47--  http://archlinux.unixheads.org/extra/os/i686/extra.db.tar.gz
Resolving archlinux.unixheads.org... 204.152.186.174
Connecting to archlinux.unixheads.org|204.152.186.174|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 422622 (413K) [application/x-gzip]
Saving to: `extra.db.tar.gz'

100%[==============================================================================>] 422,622      253K/s   in 1.6s    

2008-11-10 08:02:02 (253 KB/s) - `extra.db.tar.gz' saved [422622/422622]

--2008-11-10 08:02:02--  http://archlinux.unixheads.org/community/os/i686/community.db.tar.gz
Resolving archlinux.unixheads.org... 204.152.186.174
Connecting to archlinux.unixheads.org|204.152.186.174|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 369845 (361K) [application/x-gzip]
Saving to: `community.db.tar.gz'

100%[==============================================================================>] 369,845      262K/s   in 1.4s    

2008-11-10 08:02:17 (262 KB/s) - `community.db.tar.gz' saved [369845/369845]


real    0m44.153s
user    0m0.047s
sys    0m0.017s

Ubuntu: 0m3.837s vs. Arch: 0m44.153s
I get the same update time whenever I update pacman normally.

I have googled a lot to figure out an answer, but nothing helps, so I was hoping somebody could help me figure this out, as it's very annoying. My hosts file looks like this

hosts:

#
# /etc/hosts: static lookup table for host names
#

#<ip-address>    <hostname.domain.org>    <hostname>
127.0.0.1    localhost.localdomain    localhost arch

# End of file

rc.conf:

#
# /etc/rc.conf - Main Configuration for Arch Linux
#

# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# HARDWARECLOCK: set to "UTC" or "localtime"
# USEDIRECTISA: use direct I/O requests instead of /dev/rtc for hwclock
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages
#
LOCALE="en_US.utf8"
HARDWARECLOCK="UTC"
USEDIRECTISA="no"
TIMEZONE="Asia/Singapore"
KEYMAP="dk"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

# -----------------------------------------------------------------------
# HARDWARE
# -----------------------------------------------------------------------
#
# MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed
# MOD_BLACKLIST: Prevent udev from loading these modules
# MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
#
# NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
#
MOD_AUTOLOAD="yes"
#MOD_BLACKLIST=() #deprecated
MODULES=(e100 mii iwl3945 fuse acpi-cpufreq cpufreq_ondemand cpufreq_conservative cpufreq_powersave loop !pcspkr !snd_pcsp)

# Scan for LVM volume groups at startup, required if you use LVM
USELVM="no"

# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="arch"

# Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces.
#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
#   - prefix an entry in INTERFACES with a ! to disable it
#   - no hyphens in your interface names - Bash doesn't like it
# 
# DHCP:     Set your interface to "dhcp" (eth0="dhcp")
# Wireless: See network profiles below
#
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
eth0="dhcp"
INTERFACES=(!eth0 !wlan0)

# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
#   - prefix an entry in ROUTES with a ! to disable it
#
gateway="default gw 192.168.0.1"
ROUTES=(!gateway)
 
# Enable these network profiles at boot-up.  These are only useful
# if you happen to need multiple network configurations (ie, laptop users)
#   - set to 'menu' to present a menu during boot-up (dialog package required)
#   - prefix an entry with a ! to disable it
#
# Network profiles are found in /etc/network.d
#
# This now requires the netcfg package
#
#NETWORKS=(main)

# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
# Daemons to start at boot-up (in this order)
#   - prefix a daemon with a ! to disable it
#   - prefix a daemon with a @ to start it up in the background
#
DAEMONS=(syslog-ng !network hal !netfs crond fam wicd cups laptop-mode oss gdm)

SPLASH="splashy"

Thanks in advance!

Last edited by Sharpeee (2008-11-15 10:39:42)

Offline

#2 2008-11-10 00:29:12

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: [SOLVED] Slow DNS lookup, I think

Perhaps an obvious question, but are you using the same nameservers on both systems?


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#3 2008-11-10 00:32:36

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: [SOLVED] Slow DNS lookup, I think

Does your /etc/resolv.conf look the same in Arch and Ubuntu? And how do you run your network in Arch, wicd? I don't know it, but I see that you've disabled the usual network configuration in rc.conf.


1000

Offline

#4 2008-11-10 02:10:47

Sharpeee
Member
From: Denmark
Registered: 2008-10-19
Posts: 59

Re: [SOLVED] Slow DNS lookup, I think

Thanks for the quick answer guys.

To connect I use wicd in both Ubuntu and Arch. My resolv.conf looks like this both in Ubuntu

domain gateway.2wire.net
search gateway.2wire.net
nameserver 192.168.1.254

Right now I'm at my school, NUS, so my resolv.conf doesn't have have the usual values, but I'm pretty sure it's the same in Arch. The weird thing though, is that the problem doesn't seem to be there here? I posted my question this morning before going to school, and did the tests posted before, so I know the problem is there at home.

My resolv.conf looks like this in Arch now

search nus.edu.sg
nameserver 137.132.0.254
nameserver 137.132.0.252

Any ideas why I have a problem at home but not here?

Offline

#5 2008-11-10 02:48:50

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

Re: [SOLVED] Slow DNS lookup, I think

It appears you're using different DNS servers in Ubuntu than what you are in Arch. Have a look at the differences between resolv.conf in Arch and Ubuntu when you're at home. Make sure Arch is using the same ones as Ubuntu.

Offline

#6 2008-11-10 14:39:23

Sharpeee
Member
From: Denmark
Registered: 2008-10-19
Posts: 59

Re: [SOLVED] Slow DNS lookup, I think

I finally got back from school and just checked my /etc/resolv.conf files. In Ubuntu it looks like this

domain gateway.2wire.net
search gateway.2wire.net
nameserver 192.168.1.254

Arch

search gateway.2wire.net
nameserver 192.168.1.254

So what I read from that is that wicd doesn't get at domain server in Arch, but does in Ubuntu? Is this the reason for my slow dns lookup?

Offline

#7 2008-11-10 15:25:54

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: [SOLVED] Slow DNS lookup, I think

I'm not sure that's the problem, perhaps you should try to disable IPv6...


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#8 2008-11-10 15:49:32

Sharpeee
Member
From: Denmark
Registered: 2008-10-19
Posts: 59

Re: [SOLVED] Slow DNS lookup, I think

Already did that I'm afraid!

Offline

#9 2008-11-10 21:37:53

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

Re: [SOLVED] Slow DNS lookup, I think

I'm out of ideas, sorry hmm

Offline

#10 2008-11-10 21:59:25

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: [SOLVED] Slow DNS lookup, I think

Maybe try with a different network manager, such as NetworkManager or even better, netcfg2.


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#11 2008-11-10 22:46:31

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: [SOLVED] Slow DNS lookup, I think

try to remove "search ...." line from resolv.conf and leave only nameserver line

Last edited by wonder (2008-11-10 22:46:51)


Give what you have. To someone, it may be better than you dare to think.

Offline

#12 2008-11-11 03:11:35

Sharpeee
Member
From: Denmark
Registered: 2008-10-19
Posts: 59

Re: [SOLVED] Slow DNS lookup, I think

I will try that, but why does it work fine in Ubuntu with the "search" line though?

I already did try another network manager. I installed "gnome-network-manager-svn" from AUR, and same thing. The resolv.conf file was different, I think, but it was still slow when I was home. It's really weird that it only applies when I'm at home?

Offline

#13 2008-11-11 04:34:16

Sharpeee
Member
From: Denmark
Registered: 2008-10-19
Posts: 59

Re: [SOLVED] Slow DNS lookup, I think

Just tried to remove the "search..." line from my /etc/resolv.conf file, but nothing! It's okay if I remove the line after it connects right? Wicd overwrites the file anyways if I reconnect.

I don't really think changing to a different network-manager will help me. It works perfectly fine in Ubuntu with both network-manager and wicd, do don't think that's the problem. It must be a configuration file somewhere.

#### EDIT ####

I just tried to disable wicd and enable the wired network in /etc/rc.conf. After a reboot and it's still the same, even on the wired, so it's got be some other settings somewhere that's messing things up!

Also, for some reason my theme, in Gnome, isn't loaded after I disabled wicd? I have to manually run "gnome-appearance-manager"??

Last edited by Sharpeee (2008-11-11 05:01:46)

Offline

#14 2008-11-15 06:14:20

Sharpeee
Member
From: Denmark
Registered: 2008-10-19
Posts: 59

Re: [SOLVED] Slow DNS lookup, I think

Nobody has any ideas? It is a very strange problem that is really annoying!

I have tried to boot from a USB pen to a "fresh" version of Arch, the installation environment, and there were no problems there. So it must be something I have installed og a configuration file I have changed somewhere that is messing with my network?

Offline

#15 2008-11-15 06:18:03

cardinals_fan
Member
From: /dev/null
Registered: 2008-02-03
Posts: 248

Re: [SOLVED] Slow DNS lookup, I think

This worked for me: http://wiki.archlinux.org/index.php/Spe … th_dnsmasq

Save your resolv.conf in root and add a line in /etc/rc.local (before any dhcpcd entries) to copy it over to /etc/


Segmentation fault (core dumped)

Offline

#16 2008-11-15 06:42:38

Sharpeee
Member
From: Denmark
Registered: 2008-10-19
Posts: 59

Re: [SOLVED] Slow DNS lookup, I think

Didn't do anything! I have tried with the OpenDNS servers before, and it doesn't seem to matter which DNS servers I use, it always take forever to d the "Looking up xxx" part.

Offline

#17 2008-11-15 08:35:20

briest
Member
From: Katowice, PL
Registered: 2006-05-04
Posts: 468

Re: [SOLVED] Slow DNS lookup, I think

It's unlikely you ever mangled with it, but how does "hosts" line in /etc/nsswitch.conf look?

Offline

#18 2008-11-15 09:54:53

Sharpeee
Member
From: Denmark
Registered: 2008-10-19
Posts: 59

Re: [SOLVED] Slow DNS lookup, I think

In Arch it looks like this

hosts: files wins dns

In Ubuntu:

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4

This is simply just a "cat /etc/nsswitch.conf | grep hosts", hope that is what you meant.

Offline

#19 2008-11-15 10:05:13

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: [SOLVED] Slow DNS lookup, I think

last ideea
try to do: "sysctl -w net.ipv4.tcp_timestamps=0" as root

other ideea is to  modify host line in /etc/nsswitch.conf  like that:
hosts: files dns

Last edited by wonder (2008-11-15 10:10:45)


Give what you have. To someone, it may be better than you dare to think.

Offline

#20 2008-11-15 10:20:25

Sharpeee
Member
From: Denmark
Registered: 2008-10-19
Posts: 59

Re: [SOLVED] Slow DNS lookup, I think

You are my hero wonder!! I will name my firstborn after you, seriously!! And of course you to briest wink

It was the "hosts: files dns" change that did the trick!

Last edited by Sharpeee (2008-11-15 10:21:51)

Offline

#21 2008-11-15 10:23:13

Sharpeee
Member
From: Denmark
Registered: 2008-10-19
Posts: 59

Re: [SOLVED] Slow DNS lookup, I think

Okay, so now my question is, why was this not a problem when I was at school, but only at home??

Offline

#22 2008-11-15 10:35:32

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: [SOLVED] Slow DNS lookup, I think

maybe there is a server who respond to wins request.
wins is: http://en.wikipedia.org/wiki/Windows_In … me_Service
also how wins get in nsswitch?

Last edited by wonder (2008-11-15 10:35:54)


Give what you have. To someone, it may be better than you dare to think.

Offline

#23 2008-11-15 10:40:52

Sharpeee
Member
From: Denmark
Registered: 2008-10-19
Posts: 59

Re: [SOLVED] Slow DNS lookup, I think

I have no clue! I haven't changed anything in that file, didn't even know it existed. But right now, I'm just happy my snappy internet is back smile

Offline

#24 2008-12-02 23:38:28

nto
Member
Registered: 2008-10-11
Posts: 10

Re: [SOLVED] Slow DNS lookup, I think

I found this thread and I was having the exact same problem you described, though not the same solution. In my case the university I go to apparently supports IPv6 but at home I don't have support for it. Disabling it fixed it for me. Thanks finferflu smile

Offline

Board footer

Powered by FluxBB