# Long time to DNS resolving

## zrebec

Hello,

I have DSL internet connection (ADSL2+) and router is Wireless router Vigor 2700 Series. I'm behind router and I'm going out via NAT. But it's too long time to convert DNS name to IP (long time DNS resolving). It's OK only if I add line some public DNS IP to /etc/resolv.conf.

Long time DNS resolving:

```

/etc/resolv.conf

nameserver 192.168.1.1

```

Normal time to DNS resolve:

```

/etc/resolv.conf

nameserver 195.146.132.*** # DNS server of my provider

nameserver 192.168.1.1 # Address of my router

```

But I tried ubuntu (normal, installed to HDD) and everything works OK (and in resolv.conf was only router address). I'm sure that this must be solution for this problem. Btw.... after every reboot is my /etc/resolv.conf rewrited to 2nd list (just with IP address of my router)

Please, know someone why I can have long time to DNS resolve with standard /etc/resolv.conf ? Thank You very much

----------

## coplaniuk

Sounds like your hub and your provider's DNS are fighting.  The problem is that your system first has to go through and figure out which DNS it should be using, and this can take a while.  I would recommend using your providers DNS as your primary at least.  You can edit your /etc/resolv.conf to include only the DNS entries for your provider.  

If you use DHCP, you'll need to edit your network config so that it doesn't overwrite your /etc/resolv.conf file (and keep a backup, just in case).  You should add a line to your /etc/conf.d/net file like:

```

config_eth0=( "dhcp" )  #this line should already exist -- and perhaps more after it

# The line below is the one you want to add.  

# You may just be able to append nodns to an existing dhcp_ command.

dhcp_eth0="nodns"  

```

More info can be found on gentoo's docs:  http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=3#doc_chap3

So next time you start the network up (or boot), it shouldn't have any question as to what its DNS is, and it should resolve fairly quickly.

----------

## PaulBredbury

You need to check which nameserver your router is using. It's probably configured to automatically look up and use your ISP's nameserver.

Anyway, such nameservers can be slow and contain stale info, so I always recommend to install BIND on the PC, and use:

```
nameserver 127.0.0.1
```

----------

## madisonicus

 *PaulBredbury wrote:*   

> You need to check which nameserver your router is using. It's probably configured to automatically look up and use your ISP's nameserver.
> 
> Anyway, such nameservers can be slow and contain stale info, so I always recommend to install BIND on the PC, and use:
> 
> ```
> ...

 

Another option which I'm using successfully is net-dns/djbdns.  http://cr.yp.to/djbdns.html

-m

----------

