# network highly unreliable [SOLVED- bad dns]

## Gentree

Hi,

for over a week the networking on this box has been near unusable.

Every access takes about 10s . Ping google.com throws a line every 10s not every second.

I am connected via wifi to a "neufbox" router. The direct connection to the router works correctly so the problem is local, not WLAN, and related to the gentoo box.

If I boot from a fedora live CD, networking is fine so it's not the physical wifi setup , it's Gentoo networking.

```

bash-4.1#route -n

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 eth_mobo

192.168.1.0     0.0.0.0         255.255.255.0   U     2000   0        0 wlan1

127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo

0.0.0.0         192.168.1.1     0.0.0.0         UG    2000   0        0 wlan1
```

```
bash-4.1#ifconfig

eth_mobo  Link encap:Ethernet  HWaddr 00:04:4b:80:80:03  

          inet addr:192.168.2.3  Bcast:192.168.2.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 B)  TX bytes:1416 (1.3 KiB)

          Interrupt:20 Base address:0x2000 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:4 errors:0 dropped:0 overruns:0 frame:0

          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:200 (200.0 B)  TX bytes:200 (200.0 B)

wlan1     Link encap:Ethernet  HWaddr 00:1e:58:9e:61:81  

          inet addr:192.168.1.50  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1482  Metric:1

          RX packets:2703 errors:0 dropped:0 overruns:0 frame:0

          TX packets:2248 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:1305923 (1.2 MiB)  TX bytes:306220 (299.0 KiB)

```

Looks to be correct. 

Any ideas where I need to look?

TIA, Gentree.   :Cool: 

----------

## palettentreter

post the output of "strace -tt ping -c 1 google.com"

----------

## krinn

trouble with routing table, your ethernet card is set to a non reachable network range .2.0 while others run on 1.0

and as your eth_mobo stats show (TX: 1416), someone try to pass by it and fail, that's why you are waiting until eth_mobo timeout.

5 choices:

1/ easy one, emerge ifplugd to allow only eth_mobo access when a cable is plug

2/ blacklist eth_mobo (look at udev to blacklist the module & openrc for the eth_mobo interface)

3/ build a bridge if you want use them both (in french, je suis trop gentil non ?) -> http://www.gentoo.org/doc/fr/handbook/handbook-x86.xml?style=printable&part=4&chap=3#doc_chap7

4/ disable the onboard network card in bios

5/ or using a hammer, you can just crush the motherboard network chip

5b/ using the hammer, crush the neufbox

I would say, choice 5 would be the funnier while doing it, but not really the better after you've done it.

5b is optional, but if you pickup choice 5 you shouldn't just stop there while you're at it  :Smile: 

----------

## Gentree

Thank you for an excellent reply. I can use a little humour. 

I don't think the neighbour would be too happy if went for 5b, since he had to leave a hefty deposit for the neufbox, so I'll have to look at the other options. 

It seems your basic assumption that eth_mobo is unconnected . That is not the case:

```
ping arm26

PING arm26.localdomain (192.168.2.50) 56(84) bytes of data.

64 bytes from arm26.localdomain (192.168.2.50): icmp_seq=1 ttl=64 time=1.09 ms

64 bytes from arm26.localdomain (192.168.2.50): icmp_seq=2 ttl=64 time=0.300 ms

64 bytes from arm26.localdomain (192.168.2.50): icmp_seq=3 ttl=64 time=0.306 ms

64 bytes from arm26.localdomain (192.168.2.50): icmp_seq=4 ttl=64 time=0.305 ms

```

This rules out options 2, 4 and 5.

option 1 would not solve it since it always connected and the problem persists. LAN response is fast and correct at the same time as wifi is shit slow.

That leaves option 3 which is quite complicated and I'm not sure if this would help. (En plus tu veux que je potasse tous ca en francais, t'es fous !)

In view of the new information about eth_mobo , what do you suggest?

thanks again.   :Cool: 

----------

## Gentree

```
 strace -tt ping -c 1 google.com

11:34:11.493093 execve("/bin/ping", ["ping", "-c", "1", "google.com"], [/* 45 vars */]) = 0

11:34:11.493427 brk(0)                  = 0x8065000

11:34:11.493464 fcntl64(0, F_GETFD)     = 0

11:34:11.493493 fcntl64(1, F_GETFD)     = 0

11:34:11.493518 fcntl64(2, F_GETFD)     = 0

11:34:11.493553 access("/etc/suid-debug", F_OK) = -1 ENOENT (No such file or directory)

11:34:11.493614 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb78b5000

11:34:11.494023 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)

11:34:11.494068 open("/etc/ld.so.cache", O_RDONLY) = 3

11:34:11.494105 fstat64(3, {st_mode=S_IFREG|0644, st_size=143516, ...}) = 0

11:34:11.494155 mmap2(NULL, 143516, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7891000

11:34:11.494186 close(3)                = 0

11:34:11.494223 open("/lib/libresolv.so.2", O_RDONLY) = 3

11:34:11.494258 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 &\0\0004\0\0\0"..., 512) = 512

11:34:11.494305 fstat64(3, {st_mode=S_IFREG|0755, st_size=71296, ...}) = 0

11:34:11.494349 mmap2(NULL, 84040, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb787c000

11:34:11.494381 mmap2(0xb788d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10) = 0xb788d000

11:34:11.494430 mmap2(0xb788f000, 6216, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb788f000

11:34:11.494470 close(3)                = 0

11:34:11.494506 open("/lib/libc.so.6", O_RDONLY) = 3

11:34:11.494540 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20m\1\0004\0\0\0"..., 512) = 512

11:34:11.494583 fstat64(3, {st_mode=S_IFREG|0755, st_size=1339676, ...}) = 0

11:34:11.494627 mmap2(NULL, 1349928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7732000

11:34:11.495255 mprotect(0xb7875000, 4096, PROT_NONE) = 0

11:34:11.495286 mmap2(0xb7876000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x143) = 0xb7876000

11:34:11.495330 mmap2(0xb7879000, 10536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7879000

11:34:11.495370 close(3)                = 0

11:34:11.495418 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7731000

11:34:11.495452 set_thread_area({entry_number:-1 -> 6, base_addr:0xb77316c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0

11:34:11.495583 mprotect(0xb7876000, 8192, PROT_READ) = 0

11:34:11.495621 mprotect(0xb788d000, 4096, PROT_READ) = 0

11:34:11.496059 mprotect(0x8050000, 4096, PROT_READ) = 0

11:34:11.496094 mprotect(0xb78d3000, 4096, PROT_READ) = 0

11:34:11.496123 munmap(0xb7891000, 143516) = 0

11:34:11.496189 socket(PF_INET, SOCK_RAW, IPPROTO_ICMP) = -1 EPERM (Operation not permitted)

11:34:11.496239 getuid32()              = 1000

11:34:11.496268 setuid32(1000)          = 0

11:34:11.496386 brk(0)                  = 0x8065000

11:34:11.496413 brk(0x8086000)          = 0x8086000

11:34:11.496451 getpid()                = 5910

11:34:11.496486 open("/etc/resolv.conf", O_RDONLY) = 3

11:34:11.496533 fstat64(3, {st_mode=S_IFREG|0644, st_size=81, ...}) = 0

11:34:11.496579 mmap2(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb78a5000

11:34:11.496611 read(3, "nameserver 212.151.136.246\nnames"..., 65536) = 81

11:34:11.499177 read(3, "", 65536)      = 0

11:34:11.499211 close(3)                = 0

11:34:11.499240 munmap(0xb78a5000, 65536) = 0

11:34:11.499276 uname({sys="Linux", node="linbox", ...}) = 0

11:34:11.499352 time(NULL)              = 1284284051

11:34:11.499379 stat64("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=81, ...}) = 0

11:34:11.499432 open("/etc/resolv.conf", O_RDONLY) = 3

11:34:11.499468 fstat64(3, {st_mode=S_IFREG|0644, st_size=81, ...}) = 0

11:34:11.499510 mmap2(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb78a5000

11:34:11.499541 read(3, "nameserver 212.151.136.246\nnames"..., 65536) = 81

11:34:11.499585 read(3, "", 65536)      = 0

11:34:11.499613 close(3)                = 0

11:34:11.500226 munmap(0xb78a5000, 65536) = 0

11:34:11.500262 uname({sys="Linux", node="linbox", ...}) = 0

11:34:11.500344 socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3

11:34:11.500384 connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)

11:34:11.500446 close(3)                = 0

11:34:11.500480 socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3

11:34:11.500511 connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)

11:34:11.500560 close(3)                = 0

11:34:11.500592 open("/etc/nsswitch.conf", O_RDONLY) = 3

11:34:11.501640 fstat64(3, {st_mode=S_IFREG|0644, st_size=508, ...}) = 0

11:34:11.501689 mmap2(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb78a5000

11:34:11.501722 read(3, "# /etc/nsswitch.conf:\n# $Header:"..., 65536) = 508

11:34:11.501789 read(3, "", 65536)      = 0

11:34:11.501819 close(3)                = 0

11:34:11.501847 munmap(0xb78a5000, 65536) = 0

11:34:11.501894 open("/etc/ld.so.cache", O_RDONLY) = 3

11:34:11.501933 fstat64(3, {st_mode=S_IFREG|0644, st_size=143516, ...}) = 0

11:34:11.501975 mmap2(NULL, 143516, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb789100011:34:11.502006 close(3)                = 0

11:34:11.502042 open("/lib/libnss_files.so.2", O_RDONLY) = 3

11:34:11.502078 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\32\0\0004\0\0\0"..., 512) = 512

11:34:11.502125 fstat64(3, {st_mode=S_IFREG|0755, st_size=42432, ...}) = 0

11:34:11.502173 mmap2(NULL, 45772, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7725000

11:34:11.502206 mmap2(0xb772f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9) = 0xb772f000

11:34:11.502259 close(3)                = 0

11:34:11.502308 mprotect(0xb772f000, 4096, PROT_READ) = 0

11:34:11.502341 munmap(0xb7891000, 143516) = 0

11:34:11.502378 open("/etc/host.conf", O_RDONLY) = 3

11:34:11.502415 fstat64(3, {st_mode=S_IFREG|0644, st_size=935, ...}) = 0

11:34:11.502455 mmap2(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb78a5000

11:34:11.502485 read(3, "# /etc/host.conf:\n# $Header: /va"..., 65536) = 935

11:34:11.502538 read(3, "", 65536)      = 0

11:34:11.502567 close(3)                = 0

11:34:11.502594 munmap(0xb78a5000, 65536) = 0

11:34:11.503001 open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 3

11:34:11.503046 fcntl64(3, F_GETFD)     = 0x1 (flags FD_CLOEXEC)

11:34:11.503085 fstat64(3, {st_mode=S_IFREG|0644, st_size=1719, ...}) = 0

11:34:11.503127 mmap2(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb78a5000

11:34:11.503157 read(3, "# /etc/hosts:  This file describ"..., 65536) = 1719

11:34:11.503226 read(3, "", 65536)      = 0

11:34:11.503257 close(3)                = 0

11:34:11.503284 munmap(0xb78a5000, 65536) = 0

11:34:11.503318 open("/etc/ld.so.cache", O_RDONLY) = 3

11:34:11.503352 fstat64(3, {st_mode=S_IFREG|0644, st_size=143516, ...}) = 0

11:34:11.503392 mmap2(NULL, 143516, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7891000

11:34:11.503422 close(3)                = 0

11:34:11.503454 open("/lib/libnss_dns.so.2", O_RDONLY) = 3

11:34:11.503489 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\300\v\0\0004\0\0\0"..., 512) = 512

11:34:11.503533 fstat64(3, {st_mode=S_IFREG|0755, st_size=21896, ...}) = 0

11:34:11.503577 mmap2(NULL, 24708, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb771e000

11:34:11.503610 mmap2(0xb7723000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4) = 0xb7723000

11:34:11.503668 close(3)                = 0

11:34:11.503713 mprotect(0xb7723000, 4096, PROT_READ) = 011:34:11.503783 munmap(0xb7891000, 143516) = 0

11:34:11.503823 time(NULL)              = 1284284051

11:34:11.503880 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 3

11:34:11.504672 connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("212.151.136.246")}, 28) = 0

11:34:11.504729 gettimeofday({1284284051, 504743}, NULL) = 0

11:34:11.504764 poll([{fd=3, events=POLLOUT}], 1, 0) = 1 ([{fd=3, revents=POLLOUT}])

11:34:11.504806 send(3, "v_\1\0\0\1\0\0\0\0\0\0\6google\3com\0\0\1\0\1", 28, MSG_NOSIGNAL) = 28

11:34:11.504894 poll([{fd=3, events=POLLIN}], 1, 5000) = 0 (Timeout)

11:34:16.510860 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 5

11:34:16.510916 connect(5, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("212.151.137.170")}, 28) = 0

11:34:16.510960 gettimeofday({1284284056, 510972}, NULL) = 0

11:34:16.510989 poll([{fd=5, events=POLLOUT}], 1, 0) = 1 ([{fd=5, revents=POLLOUT}])

11:34:16.511029 send(5, "v_\1\0\0\1\0\0\0\0\0\0\6google\3com\0\0\1\0\1", 28, MSG_NOSIGNAL) = 28

11:34:16.511108 poll([{fd=5, events=POLLIN}], 1, 3000^C <unfinished ...>

```

 :Confused: 

----------

## Gentree

BTW , at about the time I started having this trouble I noticed that a pci NIC did not have it's leds on when connected. I concluded it was likely faulty and removed it. This was previously the LAN connection , not eth_mobo.

It was an  Ethernet Pro 100 using e100 module. 

I have replaced it with a realtek 8139 but can't get udev to match it by module, neither 8139cp nor 8139too cause a udev match 

KERNEL=="eth*", ACTION=="add", DRIVERS=="8139cp", NAME="eth_real"

So at this time it is "down". I also pulled it and it did not affect the current issue.

----------

## krinn

that dns query got timeout for 212.151.136.246, try using google ones, easy to remember, prim is at 4.4.4.4 and sec at 8.8.8.8

and your first dns & sec dns server also fail on my computer to answer, bad ip, or bad dns server  :Smile: 

----------

## Gentree

Ah! all becomes clear. 

in changing the nics , the new one was unconfigured and caused a dhcp lookup at boot time . This TOOK-OUT my resolv.conf. I restored it from an old copy which did work . The ones you indicate are tele2 dns servers (I was with tele2 before they got bought out by SFR. Looks like SFR have removed them as dns servers although whois still shows them as tele2 IPs).

More importantly when I add 4.4.4.4 and 8.8.8.8 the problem remains. 

It seems that Neuf have decided to block all but their dns servers. "All the better to watch you, my dear." 

With only one entry to a neuf dns , network access has returned to normal.

nameserver 84.103.237.146

Thanks very much for your help . It would have taken me a while to spot this. 

 :Cool: 

----------

