# DNS issue - ipv6 disabled - but "not really"?

## alashain

Hey... 

I am experiencing very slow DNS lookups with most software.

I have uncommented the line in aliases.conf to make it not load ipv6.

To reproduce my issues, I run the following four commands:

```
wget -4 google.ch

wget google.ch

wget -6 google.ch
```

wget -6 fails instantly. "Name or service not known"

wget works, but it takes ages to resolve the DNS (lynx, python etc operate equally slowly)

tcpdump:

```
wget google.ch - SLOW

03:47:38.540987 IP 192.168.0.44.57293 > 208.67.222.222.domain: 47030+ A? google.ch. (27)

03:47:38.541033 IP 192.168.0.44.57293 > 208.67.222.222.domain: 50058+ AAAA? google.ch. (27)

03:47:38.679959 IP 208.67.222.222.domain > 192.168.0.44.57293: 47030 6/0/0 A 209.85.135.105, A 209.85.135.147, A 209.85.135.104, A 209.85.135.106, A 209.85.135.103, A 209.85.135.99 (123)

03:47:43.541344 IP 192.168.0.44.57293 > 208.67.222.222.domain: 47030+ A? google.ch. (27)

03:47:43.591126 IP 208.67.222.222.domain > 192.168.0.44.57293: 47030 6/0/0 A 209.85.135.103, A 209.85.135.99, A 209.85.135.105, A 209.85.135.147, A 209.85.135.104, A 209.85.135.106 (123)

03:47:43.591224 IP 192.168.0.44.57293 > 208.67.222.222.domain: 50058+ AAAA? google.ch. (27)

03:47:48.546332 IP 192.168.0.44.34923 > 208.67.222.222.domain: 47030+ A? google.ch. (27)

03:47:48.598239 IP 208.67.222.222.domain > 192.168.0.44.34923: 47030 6/0/0 A 209.85.135.106, A 209.85.135.103, A 209.85.135.99, A 209.85.135.105, A 209.85.135.147, A 209.85.135.104 (123)

03:47:48.598386 IP 192.168.0.44.49531 > 208.67.222.222.domain: 50058+ AAAA? google.ch. (27)

03:47:48.651400 IP 208.67.222.222.domain > 192.168.0.44.49531: 50058 0/0/0 (27)

03:47:48.740217 IP 192.168.0.44.59166 > 208.67.222.222.domain: 6965+ A? www.google.ch. (31)

03:47:48.740308 IP 192.168.0.44.59166 > 208.67.222.222.domain: 57338+ AAAA? www.google.ch. (31)

03:47:48.793031 IP 208.67.222.222.domain > 192.168.0.44.59166: 6965 8/0/0 CNAME www.google.com., CNAME www.l.google.com., A 209.85.135.105, A 209.85.135.106, A 209.85.135.147, A 209.85.135.103, A 209.85.135.99, A 209.85.135.104 (175)

03:47:53.745115 IP 192.168.0.44.59166 > 208.67.222.222.domain: 6965+ A? www.google.ch. (31)

03:47:53.808854 IP 208.67.222.222.domain > 192.168.0.44.59166: 6965 8/0/0 CNAME www.google.com., CNAME www.l.google.com., A 209.85.135.105, A 209.85.135.103, A 209.85.135.106, A 209.85.135.104, A 209.85.135.147, A 209.85.135.99 (175)

03:47:53.808949 IP 192.168.0.44.59166 > 208.67.222.222.domain: 57338+ AAAA? www.google.ch. (31)

03:47:58.750016 IP 192.168.0.44.39893 > 208.67.222.222.domain: 6965+ A? www.google.ch. (31)

03:47:58.803568 IP 208.67.222.222.domain > 192.168.0.44.39893: 6965 8/0/0 CNAME www.google.com., CNAME www.l.google.com., A 209.85.135.103, A 209.85.135.106, A 209.85.135.104, A 209.85.135.147, A 209.85.135.99, A 209.85.135.105 (175)

03:47:58.803713 IP 192.168.0.44.44544 > 208.67.222.222.domain: 57338+ AAAA? www.google.ch. (31)

03:47:58.856832 IP 208.67.222.222.domain > 192.168.0.44.44544: 57338 2/0/0 CNAME www.google.com., CNAME www.l.google.com. (79)
```

wget -4 on the other hand is blazing fast.

```
wget -4 google.ch

listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes

03:49:22.391389 IP 192.168.0.44.40402 > 208.67.222.222.domain: 4493+ A? google.ch. (27)

03:49:22.441822 IP 208.67.222.222.domain > 192.168.0.44.40402: 4493 6/0/0 A 209.85.135.147, A 209.85.135.104, A 209.85.135.106, A 209.85.135.103, A 209.85.135.99, A 209.85.135.105 (123)

03:49:22.442331 IP 192.168.0.44.48135 > 208.67.222.222.domain: 3492+ A? google.ch. (27)

03:49:22.495850 IP 208.67.222.222.domain > 192.168.0.44.48135: 3492 6/0/0 A 209.85.135.147, A 209.85.135.104, A 209.85.135.106, A 209.85.135.103, A 209.85.135.99, A 209.85.135.105 (123)

03:49:22.587761 IP 192.168.0.44.46082 > 208.67.222.222.domain: 16837+ A? www.google.ch. (31)

03:49:22.641294 IP 208.67.222.222.domain > 192.168.0.44.46082: 16837 8/0/0 CNAME www.google.com., CNAME www.l.google.com., A 209.85.135.103, A 209.85.135.106, A 209.85.135.104, A 209.85.135.147, A 209.85.135.99, A 209.85.135.105 (175)

03:49:22.641664 IP 192.168.0.44.35000 > 208.67.222.222.domain: 45549+ A? www.google.ch. (31)

03:49:22.697709 IP 208.67.222.222.domain > 192.168.0.44.35000: 45549 8/0/0 CNAME www.google.com., CNAME www.l.google.com., A 209.85.135.103, A 209.85.135.106, A 209.85.135.104, A 209.85.135.147, A 209.85.135.99, A 209.85.135.105 (175)
```

Why would setting -4 explicitly be any different from running wget without the -4 switch? I mean ipv6 seems to be disabled, but why doesn't it behave the same way then?

Any ideas?

----------

## PaulBredbury

See options single-request

Show your /etc/resolv.conf - I run bind (and I suggest you do too), so mine is:

nameserver 127.0.0.1

----------

## alashain

```
# Generated by resolvconf

nameserver 208.67.222.222

nameserver 208.67.220.220

```

after putting these lines  into resolve.conf.tail - they appear in resolve.conf. I'm not sure, but I believe it is faster now. But still in the 5 second range per DNS like that

Bind,... wouldn't that mean to run my own DNS Server...I mean wouldn't that over overkill?

----------

## PaulBredbury

BIND isn't overkill if one is sick 'n' tired of various ISPs' crappy nameservers.

But, if BIND offends thee, use dnsmasq as a compromise.

The file is resolv.conf - remove the "e" - the BSD designers were crappy spellers  :Wink: 

----------

## magic919

DJBDNS is pretty cool too as a caching DNS server.

----------

## alashain

Well.. I installed bind.. had to adjust some permissions now it works like a charm.

Thanks a lot for the suggestion.

Am I ok with just running this default config? Or should I adjust something?

----------

## PaulBredbury

We're not mindreaders - show what you changed, and your current config.

----------

