# internet speed and DNS

## shallpion

Hi everybody. Well I guess I am asking a stupid question... I found my internet speed was significantly slower than windows xp on the same machine(dual boot).

When I tried to run traceroute www.google.com it took about 4-5 seconds to give the tracing information. And I carefully observed firefox and found, if I tried to access

www.google.com, it took several seconds for "Looking up www.google.com....." status. So I guess it was a DNS issue. 

My resolv.conf

 *Quote:*   

> 
> 
> # Generated by dhcpcd from eth0
> 
> # /etc/resolv.conf.head can replace this line
> ...

 

and I did not set anything more than default of a clean install, according to the gentoo documentation. 

I am using DHCP to obtain IP and DNS address

To confirm my conjecture, I added(opendns) nameserver 208.67.222.222 to my resolv.conf and the result

was clear to see: I opened the page of www.google.com like opening a local file and the traceroute responded immediately.

Even the evolution was speeded up significantly. Everything now is at least no slower than windows XP.

So I was really curious. I turned to windows XP and ran ifconfig/all and found it was using the same three comcast DNS address.

But it is really faster than gentoo if gentoo uses the same comcast DNS address.

I tried to ping these three DNS server and found they responded very fast, at least no significantly slower than openDNS

 *Quote:*   

> 
> 
> PING 68.87.73.242 (68.87.73.242) 56(84) bytes of data.
> 
> 64 bytes from 68.87.73.242: icmp_seq=1 ttl=56 time=14.2 ms
> ...

 

and dig www.google.com gives out similar result: the comcast DNSs are similar in speed testing with openDNS. But they 

are significantly different in practical using. I do not know why... Since traceroute, evolution, pidgin, firefox etc all are in 

very low speed if I use comcast DNSs so I guess it has nothing to do with these programs. 

Finally, I set my cart net.eth0 to obtain a static IP from router and use these three comcastDNS manually in /etc/resolv.conf

surprisingly they are still much slower than in windows XP, or the openDNS. My gentoo just does not like the Comcast...

Has anybody met similar situation? Thank you.

----------

## nlsa8z6zoz7lyih3ap

I had the same problem, although with a different internet provider.

My understanding is that windows-xp caches the addresses looked up with dns, saving the time required to look them up over and over again.

For this reason i installed dnsmasq on gentoo. After it was properly configured, it made all the difference in performance that I had hoped for.

Try

emerge -av  net-dns/dnsmasq

Then you must configure    /etc/dnsmasq.conf

and /etc/conf.d/net.*  as required. dnsmasq provides its service on 127.0.0.1 (localhost) so you will want that as the first dns nameserver listed in /etc/conf.d/net.* .   (The dns servers that you want dnsmasq to use should be listed in /etc/dnsmasq.conf.)

Reboot or restart your network and dnsmasq. If you are correclty configured, then 127.0.0.1 should be the first nameserver listed in /etc/resolv.conf.

however don't edit /etc/resolv.conf as it is created by your network when it is restarted.

My instructions come with no guarantees and I may have overlooked something, but they are more or less what I did.

----------

## shallpion

 *nlsa8z6zoz7lyih3ap wrote:*   

> I had the same problem, although with a different internet provider.
> 
> My understanding is that windows-xp caches the addresses looked up with dns, saving the time required to look them up over and over again.
> 
> For this reason i installed dnsmasq on gentoo. After it was properly configured, it made all the difference in performance that I had hoped for.
> ...

 

Hi, I just found one possible solution: use -ipv6 to rebuild the system(about 40 packages to -uDN world) and type about:config in the firefox address and disable ipv6. Then everything

should be fine....

Anyway, I found to use a static IP and openDNS is faster and more convenient....

Thank you.

----------

## ianw1974

I second the ipv6 issue.  Almost anytime I saw a delay in communication with my internet connection, be it just Firefox or even from the CLI, then I disabled ipv6.  It immediately was back to normal again.

----------

## Bircoph

If you had use tcpdump you've know why ).

It tries to resolve name via ipv6 and waits till timeout.

Disable ipv6 if it is not used properly in your network.

----------

## shallpion

 *ianw1974 wrote:*   

> I second the ipv6 issue.  Almost anytime I saw a delay in communication with my internet connection, be it just Firefox or even from the CLI, then I disabled ipv6.  It immediately was back to normal again.

 

Yeah I feel a little strange here since in my memory Debian works pretty well on this issue.

----------

## shallpion

 *Bircoph wrote:*   

> If you had use tcpdump you've know why ).
> 
> It tries to resolve name via ipv6 and waits till timeout.
> 
> Disable ipv6 if it is not used properly in your network.

 

Hi dear Bircoph. I just emerged tcpdump and it seems a little fancy for me  :Smile:  Could you please be more specific 

about how to listen to my firefox? I ran tcpdump in terminal and opened a firefox windows, with or without ipv6 function

yes I can see something different between but I do not know how should I "realize" it was "failure to resolve ipv6 address"

Thank you....

----------

## shallpion

I guess this is the problem...

 *Quote:*   

> 
> 
> 18:43:34.083181 IP cns.manassaspr.va.dc02.comcast.net.domain > 192.168.1.101.59024: 61502 NXDomain 0/0/0 (44)
> 
> 18:43:34.442939 IP 192.168.1.101.60439 > cns.manassaspr.va.dc02.comcast.net.domain: 20584+ A? www.google.com. (32)
> ...

 

A google search indicated me that AAAA stands for ipv6 address in DNS resource records.

----------

## xtz

 *nlsa8z6zoz7lyih3ap wrote:*   

> ...
> 
> If you are correclty configured, then 127.0.0.1 should be the first nameserver listed in /etc/resolv.conf.
> 
> however don't edit /etc/resolv.conf as it is created by your network when it is restarted.
> ...

 

If you configure your network correctly, it may not reconfigure it (or configure it with the settings you want). It all depends on you.

----------

## shallpion

 *xtz wrote:*   

>  *nlsa8z6zoz7lyih3ap wrote:*   ...
> 
> If you are correclty configured, then 127.0.0.1 should be the first nameserver listed in /etc/resolv.conf.
> 
> however don't edit /etc/resolv.conf as it is created by your network when it is restarted.
> ...

 

I think if you choose DHCP then dhcpcd will rewrite resolv.conf, if you do want to add some personal configuration besides the defaul dhcp setting

you can write them to file /etc/resolv.conf.head or /etc/resolv.conf.tail

----------

## Suicidal

I just edit /etc/ndcd.conf

comment out the passwd and group sections and add nscd to the default runlevel.

----------

## xtz

 *shallpion wrote:*   

>  *xtz wrote:*    *nlsa8z6zoz7lyih3ap wrote:*   ...
> 
> If you are correclty configured, then 127.0.0.1 should be the first nameserver listed in /etc/resolv.conf.
> 
> however don't edit /etc/resolv.conf as it is created by your network when it is restarted.
> ...

 

From /etc/conf.d/net.example:

```

# GENERIC DHCP OPTIONS

# Set generic DHCP options like so

#dhcp_eth0="release nodns nontp nonis nogateway nosendhost"

# This tells the dhcp client to release it's lease when it stops, not to

# overwrite dns, ntp and nis settings, not to set a default route and not to

# send the current hostname to the dhcp server and when it starts.

# You can use any combination of the above options - the default is not to

# use any of them.

```

----------

## MaximeG

Hi,

The problem comes from the fact you're using DHCP from your routeur, and 192.168.1.1 as the nameserver (default by dhcp).

It arises with some routeur, although I'm not sure the reason why.

You'll get rid of this issue by : 

 - turning to static PI address.

 - using a local "name" service like "bind"

I know it's not really fixes but it's two easy workarounds.

Regards,

Maxime

----------

## shallpion

 *xtz wrote:*   

>  *shallpion wrote:*    *xtz wrote:*    *nlsa8z6zoz7lyih3ap wrote:*   ...
> 
> If you are correclty configured, then 127.0.0.1 should be the first nameserver listed in /etc/resolv.conf.
> 
> however don't edit /etc/resolv.conf as it is created by your network when it is restarted.
> ...

 

I should read the example carefully :0 thank you

----------

## shallpion

 *MaximeG wrote:*   

> Hi,
> 
> The problem comes from the fact you're using DHCP from your routeur, and 192.168.1.1 as the nameserver (default by dhcp).
> 
> It arises with some routeur, although I'm not sure the reason why.
> ...

 

Hi, thank you for your suggestion. But I am a little confused... in my resolv.conf I did not see anything like 192.168.1.1 as the nameserver....

----------

## MaximeG

What do you have then?

But you're using DHCP, right ?

Regards,

Maxime

----------

## shallpion

 *MaximeG wrote:*   

> What do you have then?
> 
> But you're using DHCP, right ?
> 
> Regards,
> ...

 

Yes I was using DHCP, but I guess from resolv.conf I did not use 192.168.1.1 as nameserver.

 *Quote:*   

> 
> 
> # Generated by dhcpcd from eth0
> 
> # /etc/resolv.conf.head can replace this line
> ...

 

And from the output of tcpdump I did not see my local machine was requesting address from the router. Instead

it was actually stuck at requesting address from 68.87.73.242 through ipv6... And disabling ipv6 in firefox did solve the

time-delay issue even if I use ipv6

Thank you.

----------

