[SOLVED]route / netstat slow response nslookup fast resp.

[SOLVED]route / netstat slow response nslookup fast resp.

Postby shorewall » Jan 21st, '16, 16:53

Hi all,
I'm facing a really strange problem with my fresh Mageia5 installation.
Question is very simple: issuing a route or netstat -a command for example,I get a 4-5 seconds delay before getting the answer.
Using the -n switch response is immediate.
Everywhere searching with google the problem is addressed at slow DNS or bad DNS config.
Mine looks ok.
An nslookup command has a fast response.
Also I changed the resolv.conf to use opendns, or my local bind server configured as forwarding server, but the issue remains.
The Mageia5 box is the only machine having this issue, other old Mandriva 2010 boxes are ok.
I've also changed 3 routers to be sure about the source of this issue.
Attempted also ipv6 disabling from the control center, but no changes.
Here is my simple routing table:

Code: Select all
[root@localhost ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.0.1     0.0.0.0         UG    35     0        0 wlp3s0
link-local      0.0.0.0         255.255.0.0     U     35     0        0 wlp3s0
192.168.0.0     0.0.0.0         255.255.255.0   U     35     0        0 wlp3s0
[root@localhost ~]#




Any suggestion?

Tks in advance
Last edited by shorewall on Jan 22nd, '16, 17:36, edited 3 times in total.
shorewall
 
Posts: 4
Joined: Jan 21st, '16, 16:40

Re: route / netstat slow response nslookup instead fast res

Postby doktor5000 » Jan 21st, '16, 18:49

Please next time use code tags as explained in ftp://ftp5.gwdg.de/pub/linux/mandriva/m ... e_tags.ogv

Please post your complete /etc/resolv.conf, /etc/hosts and also your /etc/nsswitch.conf and the output of
Code: Select all
/sbin/ifconfig -a
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17630
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: route / netstat slow response nslookup instead fast res

Postby shorewall » Jan 21st, '16, 20:59

I apologize for not using code tags in my previous post.
Here te resolv.conf

Code: Select all
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 208.67.222.222


Here the ifconfig -a
Code: Select all
[root@localhost etc]# /sbin/ifconfig -a
enp0s25: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether f0:de:f1:42:22:4e  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xf2600000-f2620000 

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 26114  bytes 3235844 (3.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 26114  bytes 3235844 (3.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.100  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::5a94:6bff:fede:9d34  prefixlen 64  scopeid 0x20<link>
        ether 58:94:6b:de:9d:34  txqueuelen 1000  (Ethernet)
        RX packets 211378  bytes 256915466 (245.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 120190  bytes 13888985 (13.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost etc]#


Here /etc/hosts

Code: Select all
127.0.0.1               localhost localhost.localdomain


The /etc/nsswitch.conf

Code: Select all
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
#       compat                  Use compatibility setup for NIS
#       db                      Use the local database (.db) files
#       dns                     Use DNS (Domain Name Service)
#       files                   Use the local files
#       hesiod                  Use Hesiod for user lookups
#       ldap                    Use LDAP for user lookups
#       mdns                    Use Multicast DNS (aka Zeroconf/Rendezvous) for host lookups
#       mdns_minimal            Like mdns, but only resolve *.local
#       mdns4                   Like mdns, but only for IPv4
#       mdns6                   Like mdns, but only for IPv6
#       mdns4_minimal           Like mdns4, but only resolve *.local
#       mdns6_minimal           Like mdns6, but only resolve *.local
#       myhostname              Resolves local name
#       nis or yp               Use NIS (NIS version 2), also called YP
#       nisplus or nis+         Use NIS+ (NIS version 3)
#       pgsql                   Use NetBIOS for host lookups
#       sss                     Use SSSD (System Security Services Daemon)
#       tcb                     Use TCB for host lookups
#       tinycdb                 Use a constant database for user lookups
#       wins                    Use NetBIOS for host lookups
#       winbind                 Uses a Windows or Samba domain controller for host lookups
#       [NOTFOUND=return]       Stop searching if not found so far
#
# For more information, please read the nsswitch.conf.5 manual page.
#

# passwd: files nis
# shadow: files nis
# group:  files nis

passwd:      files
shadow:      files
group:      files

hosts:      mdns4_minimal files nis dns mdns4 myhostname
networks:   files

services:   files
protocols:   files
rpc:              files
ethers:      files
netmasks:   files
netgroup:   files
publickey:   files

bootparams:   files
automount:   files
aliases:           files


In the meantime I can confirm that the Mageia5 pc is the only one having this strange behaviour.
And also that dig or the nslookup commands are working fine.

Thanks in advance
shorewall
 
Posts: 4
Joined: Jan 21st, '16, 16:40

Re: route / netstat slow response nslookup instead fast res

Postby shorewall » Jan 22nd, '16, 10:05

Hi addressed by your request I've done some more debug and changedthe search sequence into nsswitch.conf
It appears that inserting any of the mdns search method in the path raise up the bug.
While using only file and classic dns search fix the behaviour.

Can I have any unexpected side effect configuring nsswitch in this way?

Tks

Code: Select all
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
#       compat                  Use compatibility setup for NIS
#       db                      Use the local database (.db) files
#       dns                     Use DNS (Domain Name Service)
#       files                   Use the local files
#       hesiod                  Use Hesiod for user lookups
#       ldap                    Use LDAP for user lookups
#       mdns                    Use Multicast DNS (aka Zeroconf/Rendezvous) for host lookups
#       mdns_minimal            Like mdns, but only resolve *.local
#       mdns4                   Like mdns, but only for IPv4
#       mdns6                   Like mdns, but only for IPv6
#       mdns4_minimal           Like mdns4, but only resolve *.local
#       mdns6_minimal           Like mdns6, but only resolve *.local
#       myhostname              Resolves local name
#       nis or yp               Use NIS (NIS version 2), also called YP
#       nisplus or nis+         Use NIS+ (NIS version 3)
#       pgsql                   Use NetBIOS for host lookups
#       sss                     Use SSSD (System Security Services Daemon)
#       tcb                     Use TCB for host lookups
#       tinycdb                 Use a constant database for user lookups
#       wins                    Use NetBIOS for host lookups
#       winbind                 Uses a Windows or Samba domain controller for host lookups
#       [NOTFOUND=return]       Stop searching if not found so far
#
# For more information, please read the nsswitch.conf.5 manual page.
#

# passwd: files nis
# shadow: files nis
# group:  files nis

passwd:      files
shadow:      files
group:      files

#hosts:      mdns4_minimal files nis dns mdns4 myhostname
hosts:      files dns  myhostname
networks:   files

services:   files
protocols:   files
rpc:              files
ethers:      files
netmasks:   files
netgroup:   files
publickey:   files

bootparams:   files
automount:   files
aliases:           files
shorewall
 
Posts: 4
Joined: Jan 21st, '16, 16:40

Re: route / netstat slow response nslookup instead fast res

Postby doktor5000 » Jan 22nd, '16, 12:25

Two observations:

Your router or dhcp server does not seem to provide a "search" or "domain" option. At least one of the two should be in resolv.conf IMHO.
The modification to nsswitch.conf you did means that your system doesn't resolve hosts via avahi/zeroconf/mdns which is a usual setup for servers.

For more details see
http://www.avahi.org/
https://en.wikipedia.org/wiki/Zero-conf ... networking
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17630
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [SOLVED]route / netstat slow response nslookup fast res

Postby shorewall » Jan 22nd, '16, 17:45

Hi,
I made every possible modification in the resolv and nsswitch conf but the system refuses to work fine using mdns.
Anyway now I've marked the 3D closed because suppressing the mdns usage is ok for me.
By the way my Mandriva 2010.2 which works well has no mdns tag into the host search sequence in the nsswitch.conf.
It is like the installed did 5 years ago.

Tks
shorewall
 
Posts: 4
Joined: Jan 21st, '16, 16:40


Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest

cron