# resolving taking forever under gentoo [fixed]

## -=GGW=- $ol!d $n4>|e

I just got my system up and working and everything seems fine except the net. It takes me on average 10 - 15 seconds to resolv a host. Emerging packages with a lot of downloads takes an amazing amount of time as i have to resolve a lot of different hosts. When i click a link or try to go to a website there is again a 10-12 second wait untill there is a response. This doesnt happen under kubuntu or vista so I know its not a network issue. What am I missing here?

EDIT: I'm using hardwired with Realtec, here are some specs

 *Quote:*   

> 
> 
> ping -c3 www.google.com
> 
> PING www.l.google.com (74.125.19.147) 56(84) bytes of data.
> ...

 

 *Quote:*   

> 
> 
> ping -c3 www.yahoo.com
> 
> PING www-real.wa1.b.yahoo.com (209.131.36.158) 56(84) bytes of data.
> ...

 

 *Quote:*   

> 
> 
> 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)
> 
> 05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)
> ...

 Last edited by -=GGW=- $ol!d $n4>|e on Tue May 05, 2009 11:54 am; edited 4 times in total

----------

## bunder

are you using dhcp or a manual ip?  please post /etc/resolv.conf, /etc/hosts, /etc/nsswitch.conf, and /etc/conf.d/net.

cheers

----------

## -=GGW=- $ol!d $n4>|e

dhcp, here are the files   :Smile: 

 *Quote:*   

> 
> 
> cat /etc/resolv.conf
> 
> # Generated by dhcpcd from eth1
> ...

 

 *Quote:*   

> 
> 
> cat /etc/hosts
> 
> # /etc/hosts: Local Host Database
> ...

 

 *Quote:*   

> 
> 
> cat /etc/nsswitch.conf
> 
> # /etc/nsswitch.conf:
> ...

 

 *Quote:*   

> 
> 
> cat /etc/conf.d/net
> 
> # This blank configuration will automatically use DHCP for any net.*
> ...

 

----------

## MaximeG

Hi,

Dhcp is causing it. (Well, not dhcp in itself, but the way your routeur manage it.)

If it's not an issue for you, configure your network to be static, it will magically sort this issue out  :Smile: 

If you really need to use dhcp, well, we can try to figure out another solution.

Regards,

Maxime

----------

## -=GGW=- $ol!d $n4>|e

Unfortunately I don't have controll of the router. It server anywhere from 12-18 people at a time and they come and go. What things can i try to speed it up? Maybe a different dhcp client? It seems more peppy under other installs

----------

## MaximeG

Hi,

You may have a look at this thread since it's perhaps interesting for you then : 

https://forums.gentoo.org/viewtopic-t-755501-highlight-.html

Regards,

Maxime

----------

## bunder

you could try overriding dns with "nodns" in /etc/conf.d/net and replacing /etc/resolv.conf with just this:

 *Quote:*   

> search hsd1.ca.comcast.net.
> 
> nameserver 68.87.76.178
> 
> nameserver 68.87.78.130 

 

...taking out the router's dns entry.  failing that, try it with just the router entry, or you can find another dns server to use if all three are crap.    :Confused: 

----------

## MaximeG

Yes,

I think that's the issue as well, the fact that your nameserver "is" your gateway. If you have a way to specify manually your nameserver in resolv.conf, it should do the trick.

The problem is, if you use dhcp and doesn't tell it not to override resolv.conf, it doesn't work obviously.

Regards,

Maxime

----------

## bunder

 *MaximeG wrote:*   

> Yes,
> 
> I think that's the issue as well, the fact that your nameserver "is" your gateway. If you have a way to specify manually your nameserver in resolv.conf, it should do the trick.
> 
> The problem is, if you use dhcp and doesn't tell it not to override resolv.conf, it doesn't work obviously.
> ...

 

under normal circumstances, what he had should work, but i've noticed that cheap routers aren't that great at resolving, especially if they have many hosts connected to them.  and since his router is also dishing out the isp's dns servers via dhcp, we might as well try just those, even just to test.   :Wink: 

----------

## cwr

I've just been playing a similar game trying to download from Gentoo mirrors;

the modem/router sets the address in resolv.conf to 192.168.1.1, but can

apparently no longer handle HTTP protocol 301, Moved Permanently, responses.

It goes out to lunch and stays there.

I can't touch the router, so my answer was to use OpenDNS, which in  the few

days I've been using it has worked fine.  My dhclient.conf is now:

# DHCP configuration file

# The default delay is 60 sec.

timeout 10;

# Fllakey DNS from the router; use the OpenDNS servers.

interface "eth0" {

    prepend domain-name-servers 208.67.222.222,208.67.220.220;

}

# eof

Good luck - Will

----------

## poly_poly-man

opendns sucks (as you may have read in similar threads)

install bind on your machine - you won't regret it.

----------

## -=GGW=- $ol!d $n4>|e

 *poly_poly-man wrote:*   

> opendns sucks (as you may have read in similar threads)
> 
> install bind on your machine - you won't regret it.

 

Is there a how-to for bind? I've looked around and everything seems to be talking about bind for setting up a dhcp server, not recieving an ip.   :Confused: 

----------

## poly_poly-man

 *-=GGW=- $ol!d $n4>|e wrote:*   

>  *poly_poly-man wrote:*   opendns sucks (as you may have read in similar threads)
> 
> install bind on your machine - you won't regret it. 
> 
> Is there a how-to for bind? I've looked around and everything seems to be talking about bind for setting up a dhcp server, not recieving an ip.  

 bind is not a DHCP server - it is a DNS server.

to get basic functionality out of it (no lan zones, caching enabled(?), allowed access from localhost), it should be as simple as emerge and start the named service.

----------

## -=GGW=- $ol!d $n4>|e

 *poly_poly-man wrote:*   

>  *-=GGW=- $ol!d $n4>|e wrote:*    *poly_poly-man wrote:*   opendns sucks (as you may have read in similar threads)
> 
> install bind on your machine - you won't regret it. 
> 
> Is there a how-to for bind? I've looked around and everything seems to be talking about bind for setting up a dhcp server, not recieving an ip.   bind is not a DHCP server - it is a DNS server.
> ...

 

WOW. Bind speeds up things a ton. Thanks!

----------

## cwr

 *poly_poly-man wrote:*   

> opendns sucks (as you may have read in similar threads)
> 
> install bind on your machine - you won't regret it.

 

Yes, I've read the comments, which is why I qualified my answer.  Do you know

_why_ OpenDNS sucks, or do you just dislike the name?

Will

----------

## poly_poly-man

 *cwr wrote:*   

>  *poly_poly-man wrote:*   opendns sucks (as you may have read in similar threads)
> 
> install bind on your machine - you won't regret it. 
> 
> Yes, I've read the comments, which is why I qualified my answer.  Do you know
> ...

 

#1: the weird search on bad requests. Not only very annoying to the user, but if you run anything that checks for dns validity, it will always come back valid (this screws up mail servers in particular)

#2: you expose yourself to much easier dns cache poisoning. people are likely to attack the opendns servers, because of the number of users and companies on them. One attack there gets millions of results instantly. Nobody is going to attack my server because if they do, they'll get 2 people (and like 6 computers depending on time-of-day).

#3: a non-local dns server will never be as good as a local one. consider how dns works - small udp packets back and forth for every unique host you visit (on some websites, this number can be huge - think ad.doubleclick et al). When that's in another state, you get lag (and since it's udp, probably lost packets you have to resend for). When it's running within your lan, or better yet on your machine, and caching intelligently, if you ask for a server once, you're even (or a little bit behind) with the other servers. Now ask for that host again, and the query will take milliseconds.

#4: lack of control. When you are a slave to a server like that (opendns, your isp, etc.), when you make a request, you wait until it decideds it's ready to service you. so, while it is an intelligently caching spaning server on that end, other users are using it - so you wait your turn. When you run the server, you know your results come from the official source and quickly... it asks root-servers, then the answer it got from them, and the answer it got from then and so on until someone knows who it is. This all happens on the opendns end too... butit this case, the data you need is right there.

opendns really isn't good... especially when there's so much better available.

----------

## -=GGW=- $ol!d $n4>|e

well, I couldn't configure bind correction because i'm not sure what the how-to means when it says to set up nameserver aliases in /etc/hosts for my local ip as 1.2.3.4

my localnet as home.local and my externially served domain as home.net

BUT! I did stumble upon the problem I'm getting. For some reason, my router is bieng used as a dns. If i comment out the routers ip in my resolv.conf so it looks like

 *Quote:*   

> 
> 
> cat /etc/resolv.conf
> 
> # Generated by resolvconf
> ...

 

I get normal response times. The problem is, since resolv.conf gets rewritten evertime I boot, how do i stop my router from getting added to it?[/quote]

----------

## MaximeG

By switching to static ip ? :p

Sounds like it's the easiest way to solve it.

Or install bind, as suggested before ?

Regards,

Maxime

----------

## -=GGW=- $ol!d $n4>|e

Why cant i just tell it not to use my router dns and go to the other dn's it detects from my isp? It seems like that would be the best solution, since if i comment out my routers ip, everything seems to work fine. Theres something i'm not getting here. Either way, if do have to host a dns in order to fix it, can anyone explain how to set up /etc/hosts as they describe at http://en.gentoo-wiki.com/wiki/BIND#Server_Prerequisites?

I would definitely prefer not to host a dns. :\

I have a feeling theres a major concept here i'm missing as well though.

EDIT: Well, i got fed up and started messing with the router config, figured i would take the time to reset peoples laptops as they come through and realize they can't get internet. Not sure what happened but i'm still using dhcp but now i'm getting the correct nameserver in /etc/resolv.conf   :Embarassed: 

----------

