# address resolution takes forever

## bejayel

Anyone else notice that address resolution is taking forever? I mean it literally takes 10-15 seconds just to resolve addresses. Both windows and my ubuntu live cd work perfectly, so it must be gentoo somewhere.

----------

## Dammital

See which nameservers you have specified in your /etc/resolv.conf

For each of those, try:

```
dig @<nameserver> forums.gentoo.org|grep Query
```

which will give you the query times.  If one of those digs fails, then remove it from your resolv.conf.

----------

## bejayel

the only thing in there is my router, and it passes.

----------

## NeddySeagoon

bejayel,

Whats in your /etc/hosts ?

----------

## Dammital

Does your router have a web interface you can use to determine what nameservers your ISP has dealt it?  You could test each of those individually to see if they are valid and responsive.  (Perhaps your ISP has changed nameservers, and your router won't discover this until your DHCP lease is up.)

If it has been awhile since you rebooted that router, this might be a good time.  Force a DHCP query.

Alternatively, you might hardcode your ISP's nameservers in your resolv.conf, bypassing the router entirely.

----------

## bejayel

I have a D-Link DIR-655 wireless N. I will put my isp's nameservers directly into my resolv.conf and see what happens. 

Here is my /etc/hosts

```

# /etc/hosts: Local Host Database

#

# This file describes a number of aliases-to-address mappings for the for 

# local hosts that share this file.

#

# In the presence of the domain name service or NIS, this file may not be 

# consulted at all; see /etc/host.conf for the resolution order.

#

# IPv4 and IPv6 localhost aliases

127.0.0.1   localhost pc-lauriebr

::1      localhost

#

# Imaginary network.

#10.0.0.2               myname

#10.0.0.3               myfriend

#

# According to RFC 1918, you can use the following IP networks for private 

# nets which will never be connected to the Internet:

#

#       10.0.0.0        -   10.255.255.255

#       172.16.0.0      -   172.31.255.255

#       192.168.0.0     -   192.168.255.255

#

# In case you want to be able to connect directly to the Internet (i.e. not 

# behind a NAT, ADSL router, etc...), you need real official assigned 

# numbers.  Do not try to invent your own network numbers but instead get one 

# from your network provider (if any) or from your regional registry (ARIN, 

# APNIC, LACNIC, RIPE NCC, or AfriNIC.)

#

```

And apparently i was mistaken... I removed the search line when I installed initially, but apparently it was put back in...

/etc/resolv.conf

```

# Generated by dhcpcd from eth0

# /etc/resolv.conf.head can replace this line

search gateway.2wire.net

nameserver 192.168.0.1

# /etc/resolv.conf.tail can replace this line

```

/etc/conf.d/net

```

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

config_eth0=( "dhcp" )

```

Should i just configuer net.eth0 with a static IP? It will always get the same one fromt he router anyway. My network is set up this way: I have this stupid 2Wire modem/router combo (From my ISP) but the thing is an absolute piece of garbage so i DMZ to my router and my router controls the network.gateway.2wire.net is (as you probably guessed) the address for the 2Wire piece of crap. I just cant get away from this thing.

As some of you who probably share this route experience with me know (If you have any aDSL in Canada it is probable that you have a 2wire) you can contact your ISP and some of them will flash it with firmware that only enables the modem portion and completely axes the router part of it. This is not an option for me since the internet is in my roomates name and they are scared it will break the internet or something.

----------

## kacox

I'm having the same problems, I think. My config files say the basic same things as yours. The addresses are 192.168.0.1 for me though. (My router ip). I don't know what the problem is, but it's not the router. It just takes a good 45-60 seconds before the browser responds to commands. It takes about 30 seconds from the time I press the log in (to gentoo.org) before the browser even shows a network transfer. It's like it hangs before ever hitting the network adapter...I don't know much about wireless config or even internet config. I lowered the MTU to 1450 thinking it would help with some of my 10-15% packet loss rate. If I ping from the command line 10x then it's 64 bytes in an average of 79-80MS. Go figure.

----------

## NeddySeagoon

bejayel,

```
127.0.0.1   localhost pc-lauriebr 
```

looks to be incomplete. I have 

```
127.0.0.1       <hostname>.<domain.name> <nostname> localhost.localdomain localhost
```

 If you don't have a real domain nameyou have have the other three entries, in the order shown.

----------

## kacox

So, I have 

192.168.0.1 Gentoo

We all know it's not real, but it's not caused any issues in the past. I have had the same configuration work flawlessly before. I'll try anything, though. What is the exact format of what I need after my ip address?

----------

## kacox

Well, I have discovered an interesting turn of events. I don't know why the ipv6 protocol is causing me grief but I recompiled the kernel listing ipv6 as a module, and since udev loads it automatically I used the /etc/modules.d/blacklist to blacklist ipv6 and my problems are solved! I did redo all the nameserver and host changes as well as the resolv.conf back to their prior states just to verify that it was ipv6 and nothing else. It flies now. No hang, and no problems just using ipv4 for now  :Wink: 

I searched the forums about a couple of weeks ago and saw someone trying out the ipv6 as a module solution but I don't personally see what that protocol would do to cause such a lag. Maybe it's a hardware specific issue, but I've had older kernels and they had direct ipv6 compilation without any issues. Hope this helps!

----------

## bejayel

I configured eth0 with a static IP and everything is working now. The reason was because DHCP was putting in that line to search the stupid 2wire.

As for the hostname stuff. I should put in a fake domain name? I own a .ca domain name which is pointing to the webserver right beside me.

----------

## NeddySeagoon

bejayel,

Use localdomain or your real domain name, not a fake.

----------

