# Diable IPv6 (solution to my DNS problems?)

## l_bratch

My DNS lookups have always been extremely slow on Linux over the last few years, on my Fedora Core machines and my Gentoo machines, and I think that this is possible due to Linux trying to lookup using IPv6 to start with.

I believe this is the problem because my Windows machines on the same network lookup hostnames to IPs ultra fast, and all the machines run through the same Slackware 10.0 server.  I've tried making the internal machines use the Slackware server as the DNS server, and my ISPs DNS servers, but it's always slow on Linux, fast on Windows.

In attempt to stop Gentoo looking up using IPv6, I have added "alias net-pf-10 off" to /etc/modules.conf, and I'm sure there was another config file that I removed "10" from a list of protocols to load.

However, DNS is still slow.

I believe that IPv6 is still being used, because to find out if it was, I disabled it from within Mozilla Firefox, and now Firefox is a lot quicker at looking up domains, but the rest of the system is still slow, so it is still being used system wide.

So my question - how can I properly disable IPv6, and judging by what I have told you, is this likely to be the only cause of my slow DNS lookups?

----------

## Zuti

I'm not sure if this is going to help

- dont use ipv6 in your kernel

- put -ipv6 as USE flag in /etc/make.conf

- check your /etc/hosts (put something like: 

127.0.0.1                         localhost                                 gentoo

static.internal.ip1              gentoo.box                             gentoo

static.internal.ip2              slackware.server.box              slackware

----------

## l_bratch

Won't -ipv6 in the USE flag make programmes use it?

----------

## Zuti

no, it will not compile ipv6 stuff for that app

----------

## l_bratch

OK thanks.

I've just checked and I didn't in fact have IPv6 support compiled into my kernel, so now I'm completely lost as to what is causing the slow lookups...any ideas?

Edit:

Could it be because the apps were previously compiled for IPv6 support and they are going slowly because they are trying to lookup IPv6 using a kernel that doesn't have support for it?

----------

## Zuti

I dont think so.

Did you edit your hosts file?

If your slackbox is the (dns)server put it in your resolv.conf as nameserver.

Is your slack a gateway? If it is edit your /etc/conf.d/net accordingly.

Do you have a firewall?

You can also recompile your packages without ipv6 by putting -ipv6 in your make.conf and

emerge --newuse world

I'm not sure if the problem lies in ipv6. I have something similiar to your situation, but mine configuration works perfect. I always use static intern  IP's and not dhcp.

----------

## l_bratch

Hosts file doesn't have anything to do with IPv6 in it.

I've put slackbox as the DNS, it is set to the DNS on the Linux and Windows machines on the network.

Yep it's the gateway, and set to gateway in /etc/conf.d/net

No firewalls, I'm not adding things like that until I get DNS working.

I also don't use DHCP, so that can't be the problem either.

If it's not IPv6, what else could it be?  It's definatly a problem only affecting my Linux machines...

----------

## kar1107

I have the same problem too. My fire-fox is sloowww.. particulary it

spends a lot of time in DNS resolution. I see the '..looking up ...' msg in the status bar for a long time. After a little googling I found this tip. Go to about:config 

and ensure

network.dns.disableIPv6 is set to true.

After this my firefox seems to perform better. But its still surely slower than my windows 2000 firefox in the same machine.

So I'm still trying ways to tweak. But I'm pretty sure its the DNS thing which is being the bottleneck.

If anyone knows of ways to make DNS faster (or why firefox is soo slow in looking-up), please post.

I tried giving the IP address directly and (I  think  :Rolling Eyes: ) it was fast). Surely within the same domain

(I went into www.cs.stanford.edu faculty pages on knuth), I could see *really fast* firefox performance. This again confirms the bottleneck in dns lookup

--K

----------

## kar1107

I found one other solution to speed up DNS issue. Its setting up the following in about:config

network.dnsCacheExpiration to 360 (6 minutes)

network.dnsCacheEntries to 100.

So now the lookup operation is skipped and the delay is seen only on the first visit to the site.  :Smile: 

Though the long delay of initial DNS is still there and I don't know how to avoid it.

(my ping to the dns server is as low as 13 msec.. so the problem is surely firefox specific).

If anyone finds a way to speedup firefox's DNS looking up delay please post.

----------

## kar1107

A final remark on this issue. This morning I booted up my machine and I see lookups are blazingly fast!!  :Very Happy: 

I guess an X restart or a reboot seems to take a better effect on about:config changes (just a guess.. because I didn't see such a significant fast lookups before -- yesterday). So I think the reboot helped. I don't recall tweaking anything else (apart for some hdparm...which is not related).

I read about removing ipv6 support from kernel.. I don't think it may be needed. Anyway I went ahead and just commented out the IPv6 addresses in the /etc/hosts. I know it may not really matter; but I don't really see a need of v6 for me today..none of my apps depend on it.

I also read about swapping the order of dns server entries in /etc/resolv.conf made a significant speed boost for some.

I am wondering still what fixed the problem for me  :Cool:  . I use dhcp; so the reboot got new dns server entries; but as far as I can see the entries are the same  like yesterday. 

Anyway hope this helps someone with firefox and dns lookup problem.

----------

## kar1107

If anyone is looking at this thread for firefox dns delays..

the real fix is just reverse the entires in /etc/resolv.conf

see

https://forums.gentoo.org/viewtopic-p-2373356.html#2373356

Basically primary and secondary are not loadshared evenly and primary's response is way too slow (sometimes time-outs) while secondary dns server is very free and extremely fast in response.

----------

