You are not logged in.

#1 2011-03-13 21:03:32

sskeirik
Member
Registered: 2011-03-13
Posts: 20

[SOLVED] Greetings... and DNS issues... (why is it so slow?)

Hey everybody!

My name is Stephen. I'm new to Arch (hence I'm posting in the newb forum). A bit of background: I'm a CS major in the good 'ole US of A. I used Debian/Ubuntu for 2 years before now. I actually installed Arch just yesterday, so today is my second day of usage. Why do I want to switch from Ubuntu? Several reasons, but they can all be summed up thusly: I want to tinker with and understand how my machine works. I don't want to interface with a blackbox that just "works." Arch seems to be geared towards what I want.

And I've been learning alot, haha. Which I why I am now here to ask for help.

I originally installed Arch at school. Everything was great. Then I took my laptop home and I found out something was wrong. Pacman took an extra 5-15 secs before each download started, but once the download started, I got normal speeds. I observed a similar behavior in my web browsers I tried (Firefox/Surf). No matter what I do, this behavior persists. I suspect this is a DNS issue, and thus I have tried the follow methods of correction so far.

1) Reinstalling to a default configuration.
2) Disabling IPV6.
3) Screwing around with etc/hosts, etc/resolv.conf, and etc/dhcpcd.conf (though I probably did something wrong. Also, I'm not sure how to force Arch to accept my changes after modifying these files.)

I also read somewhere that using HTTP mirrors works better for pacman, but I already was using an HTTP mirror anyway, so I knew that couldn't be the problem.

I have not tried DNS caching yet. However, given that every other machine in the house runs fine, I suspect it is my configuration that is wrong. Does anybody know how I can pinpoint this as DNS for sure? And if so, how I can fix it? Thanks for all your time/help!

Here are some config files/snippets of interest. Most of this should be straight from a basic Arch install.

etc/resolv.conf

# Generated by dhcpcd from eth0
# /etc/resolv.conf.head can replace this line
domain domain.actdsltmp
nameserver 192.168.0.1
nameserver 216.165.129.157
# /etc/resolv.conf.tail can replace this line

Note that 192.168.0.1 is the address of my router on my LAN. I believe the second address is a DNS provided by my ISP.

etc/hosts

#<ip-address>   <hostname.domain.org>   <hostname>
127.0.0.1       localhost.localdomain   localhost moebius
::1             localhost.localdomain   localhost

etc/rc.conf snippet

HOSTNAME="moebius"
eth0="dhcp"
INTERFACES=(eth0)

# 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)

Last edited by sskeirik (2011-03-14 23:21:19)

Offline

#2 2011-03-13 21:30:10

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: [SOLVED] Greetings... and DNS issues... (why is it so slow?)

Welcome to the forums.

If your default DNS server isn't working well for you, create the file /etc/resolv.conf.head and add new nameserver entries there. They will end up on the top of the list in resolv.conf.

Offline

#3 2011-03-13 21:32:13

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,265

Re: [SOLVED] Greetings... and DNS issues... (why is it so slow?)

Just wondering what DE/wm you are using too?

Offline

#4 2011-03-13 21:37:56

sskeirik
Member
Registered: 2011-03-13
Posts: 20

Re: [SOLVED] Greetings... and DNS issues... (why is it so slow?)

Right now I'm using XMonad with no DE.

I've tried both the standard network daemon and wicd, but they both seem to suffer from this issue.

Offline

#5 2011-03-14 08:10:48

lives2evil
Member
From: GMT+7
Registered: 2010-03-21
Posts: 244

Re: [SOLVED] Greetings... and DNS issues... (why is it so slow?)

Well, Try running "ping -c1 google.com"
If there's no output for a few seconds there's a high chance it's a DNS problem.
How to fix it?
I don't know big_smile. Can't see any problems.


tsujeruplive, tnarongisi... ... ... ... ɥsılƃuǝ sı sıɥʇ

Offline

#6 2011-03-14 16:53:05

sskeirik
Member
Registered: 2011-03-13
Posts: 20

Re: [SOLVED] Greetings... and DNS issues... (why is it so slow?)

Well, this is bizarre. When I run 'ping -c1 <website>', it never takes more than 100ms to return a packet. That suggests that the DNS is working.

My question is, if DNS isn't the problem, then what else could be affecting both firefox and pacman that causes them to take several extra seconds before starting a download but then once the download is started, they run at normal speeds?

Offline

#7 2011-03-14 17:06:56

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: [SOLVED] Greetings... and DNS issues... (why is it so slow?)

Could you run these:

dig google.com a
dig @8.8.8.8 google.com a

The dig command is in the dnsutils package, so install that one if you get a "command not found".

Offline

#8 2011-03-14 17:12:34

sskeirik
Member
Registered: 2011-03-13
Posts: 20

Re: [SOLVED] Greetings... and DNS issues... (why is it so slow?)

Output of 'dig google.com a'

; <<>> DiG 9.7.3 <<>> google.com a
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52741
;; 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.        10000    IN    A    74.125.65.104

;; Query time: 17 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Mon Mar 14 14:09:45 2011
;; MSG SIZE  rcvd: 44

Output of 'dig @8.8.8.8 google.com a'

; <<>> DiG 9.7.3 <<>> @8.8.8.8 google.com a
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43373
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0

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

;; ANSWER SECTION:
google.com.        229    IN    A    74.125.45.105
google.com.        229    IN    A    74.125.45.99
google.com.        229    IN    A    74.125.45.103
google.com.        229    IN    A    74.125.45.147
google.com.        229    IN    A    74.125.45.106
google.com.        229    IN    A    74.125.45.104

;; Query time: 74 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Mon Mar 14 14:10:37 2011
;; MSG SIZE  rcvd: 124

Offline

#9 2011-03-14 17:22:10

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: [SOLVED] Greetings... and DNS issues... (why is it so slow?)

As you can see, with your default DNS server (the first query) you've got a latency of only 17ms, you could try resolving some additional domain names and look at the time it takes, but based on these results I'd say your DNS resolving is working fine, at least for the google domain. The second query has a higher latency, but it's still acceptable.

Does browsing to google.com give you a delay? If not, could you run dig on a domain that does give you a delay?

One side note: if e.g. your router or pc caches DNS entries, you might get insignificant results, so you might need to explicitly tell dig to query your DNS servers directly to bypass caches. You do this with the syntax of the second command I gave you.

Offline

#10 2011-03-14 17:37:11

sskeirik
Member
Registered: 2011-03-13
Posts: 20

Re: [SOLVED] Greetings... and DNS issues... (why is it so slow?)

Well... I tried several other digs, both with my default nameserver (which is my router) and with my ISP's nameserver. The longest lookup was 394ms. However, lookups were only slow for addresses I had never visited yet. Lookups for addresses I already had visited took only ~40ms.

These times seem reasonable to me. BUT... I now have no idea where to go from here.

Offline

#11 2011-03-14 23:06:28

lives2evil
Member
From: GMT+7
Registered: 2010-03-21
Posts: 244

Re: [SOLVED] Greetings... and DNS issues... (why is it so slow?)

Well, try running this

wget -d http://ubuntustudio.org/files/US1.png

Does it pause anywhere before start downloading? Output any errors?


tsujeruplive, tnarongisi... ... ... ... ɥsılƃuǝ sı sıɥʇ

Offline

#12 2011-03-14 23:18:13

sskeirik
Member
Registered: 2011-03-13
Posts: 20

Re: [SOLVED] Greetings... and DNS issues... (why is it so slow?)

Well.... I figured out the problem. Definitely one of those facepalm moments... Here was my train of thought:

Since ping worked flawlessly, I knew there must be a problem at some higher level in the OS. So I tried other commandline networking utilities in order of increasing complexity until something broke. As I was screwing around with the host command, I found this interesting error message:

host -6 www.google.com
;; connection timed out; no servers could be reached

The -6 flag forces host to use IPv6. Note that my router is pretty old, so it's lack of IPv6 support isn't surprising. The reason why the DNS resolution was so slow was that all the high-level utilities would try IPv6 first before falling back on IPv4.

And of course, I screwed up before when I tried to disable the ipv6 module. I must have made a typo in the config file. sigh...

What can we learn from this? The host command is excellent for diagnosing DNS problems and... make sure your config files are right!

Thanks, lives2evil, Ramses de Norre, stlarch, and skottish for your questions/info. Everybody in this forum is great! smile

@lives2evil

Haha, actually, that was the first utility I tried.

Offline

Board footer

Powered by FluxBB