[Bug 435261] New: "getent hosts something.local" has long delay
https://bugzilla.novell.com/show_bug.cgi?id=435261 Summary: "getent hosts something.local" has long delay Product: openSUSE 11.0 Version: Final Platform: Other OS/Version: openSUSE 11.0 Status: NEW Severity: Major Priority: P5 - None Component: Network AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: syseng@adnovum.ch QAContact: qa@suse.de Found By: --- Is the toplevel .local somewhere hardcoded in the name service switch, getent or cache daemon? There is a strange behaviour when using "getent hosts" with a local domain in /etc/hosts. It seems to ignore the query order defined in /etc/nsswitch.conf and searches DNS. It produces a long delay until the answer appears Compare the query times for toplevel domain .local and .lokus: # time getent hosts something.local 123.123.123.123 something.local real 0m15.015s user 0m0.000s sys 0m0.004s # time getent hosts something.lokus 231.231.231.231 something.lokus real 0m0.004s user 0m0.000s sys 0m0.004s # time getent hosts 127.0.0.1 localhost.localdomain localhost 123.123.11.88 myhost.example.com myhost 123.123.123.123 something.local 231.231.231.231 something.lokus real 0m0.003s user 0m0.004s sys 0m0.000s An strace of getent shows that it first contacts nscd socket, waits for 5 seconds and then opens nsswitch.conf. This 3 times. It happens on Suse 10.1 and Suse 11.0. When removing "dns" from /etc/nsswitch.conf, then the answer comes immediately. I checked it also on Solaris and there both domains are handled identically, so it's rather a bug than a feature. I'll attach straces of the getent queries. Configuration: # cat /etc/hosts 127.0.0.1 localhost.localdomain localhost 123.123.11.88 myhost.example.com myhost 123.123.123.123 something.local 231.231.231.231 something.lokus # cat /etc/nsswitch.conf passwd: files ldap group: files ldap hosts: files dns networks: files services: files protocols: files rpc: files ethers: files netmasks: files netgroup: files ldap publickey: files bootparams: files automount: files ldap aliases: files # cat /etc/resolv.conf: nameserver 123.123.11.99 nameserver 123.123.22.88 nameserver 123.123.33.77 domain example.com search example.com my.example.com options ndots:1 Best regards, Bernd Nies -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=435261 User syseng@adnovum.ch added comment https://bugzilla.novell.com/show_bug.cgi?id=435261#c1 --- Comment #1 from Bernd Nies <syseng@adnovum.ch> 2008-10-14 09:16:01 MDT --- Created an attachment (id=245464) --> (https://bugzilla.novell.com/attachment.cgi?id=245464) strace of "getent hosts something.local" -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=435261 User syseng@adnovum.ch added comment https://bugzilla.novell.com/show_bug.cgi?id=435261#c2 --- Comment #2 from Bernd Nies <syseng@adnovum.ch> 2008-10-14 09:16:25 MDT --- Created an attachment (id=245465) --> (https://bugzilla.novell.com/attachment.cgi?id=245465) strace of "getent hosts something.lokus" -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=435261 User syseng@adnovum.ch added comment https://bugzilla.novell.com/show_bug.cgi?id=435261#c3 Bernd Nies <syseng@adnovum.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P3 - Medium --- Comment #3 from Bernd Nies <syseng@adnovum.ch> 2008-10-16 01:10:45 MDT --- An strace of "getent hosts something.local" shows that it tries to contact a multicast IP address before it timeouts for 5s: 08:31:25 ioctl(3, SIOCGIFFLAGS, {ifr_name="lo", ifr_flags=IFF_UP|IFF_LOOPBACK|IFF_RUNNING}) = 0 08:31:25 ioctl(3, SIOCGIFFLAGS, {ifr_name="lo", ifr_flags=IFF_UP|IFF_LOOPBACK|IFF_RUNNING}) = 0 08:31:25 ioctl(3, SIOCGIFFLAGS, {ifr_name="eth0", ifr_flags=IFF_UP|IFF_BROADCAST|IFF_RUNNING|IFF_MULTICAST}) = 0 08:31:25 ioctl(3, SIOCGIFINDEX, {ifr_name="eth0", ifr_index=2}) = 0 08:31:25 ioctl(3, SIOCGIFFLAGS, {ifr_name="vmnet8", ifr_flags=IFF_UP|IFF_BROADCAST|IFF_RUNNING|IFF_MULTICAST}) = 0 08:31:25 ioctl(3, SIOCGIFINDEX, {ifr_name="vmnet8", ifr_index=3}) = 0 08:31:25 setsockopt(3, SOL_IP, IP_RECVTTL, [1], 4) = 0 08:31:25 setsockopt(3, SOL_IP, IP_MULTICAST_IF, "\0\0\0\0\0\0\0\0\2\0\0\0", 12) = 0 08:31:25 sendto(3, "\231\r\1\0\0\1\0\0\0\0\0\0\tsomething\5local\0\0\34\0"..., 33, 0, {sa_family=AF_INET, sin_port=htons(5353), sin_addr=inet_addr("224.0.0.251")}, 28) = 33 08:31:25 socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4 08:31:25 setsockopt(4, SOL_IP, IP_RECVTTL, [1], 4) = 0 08:31:25 setsockopt(4, SOL_IP, IP_MULTICAST_IF, "\0\0\0\0\0\0\0\0\3\0\0\0", 12) = 0 08:31:25 sendto(4, "\231\r\1\0\0\1\0\0\0\0\0\0\tsomething\5local\0\0\34\0"..., 33, 0, {sa_family=AF_INET, sin_port=htons(5353), sin_addr=inet_addr("224.0.0.251")}, 28) = 33 08:31:25 gettimeofday({1224138685, 489039}, NULL) = 0 08:31:25 poll(^C But it ignores the lookup order defined in /etc/nsswitch.conf. It should return the entry from /etc/hosts and then stop. I checked the command "getent hosts something.local" with an entry in /etc/hosts and hosts order "files dns" on various Unixes: Operating System glibc Result ---------------------------------------------- Solaris 8 N/A OK Solaris 9 N/A OK Solaris 10 N/A OK RedHat ES 3u7 2.3.2 OK RedHat ES 4u4 2.3.4-2.25 OK SLES 9p4 2.3.3-98.94 10s delay SLES 10p1 2.4-31.30 OK Suse Linux 9.0 2.3.2-88 OK Suse Linux 10.1 2.4-28 15s delay openSUSE 11.0 2.8-14.1 15s delay -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=435261 Michal Seben <mseben@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mseben@novell.com AssignedTo|bnc-team-screening@forge.provo.novell.com |pbaudis@novell.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=435261 User pbaudis@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=435261#c4 Petr Baudis <pbaudis@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |syseng@adnovum.ch --- Comment #4 from Petr Baudis <pbaudis@novell.com> 2008-10-16 05:08:03 MDT --- Does adding 'mdns off' to /etc/host.conf fix this issue for you? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=435261 User syseng@adnovum.ch added comment https://bugzilla.novell.com/show_bug.cgi?id=435261#c5 --- Comment #5 from Bernd Nies <syseng@adnovum.ch> 2008-10-16 05:55:48 MDT --- Ah, new feature ... yes, it turns off the delay. But on SLES 10p1 there is no "mdns off" in /etc/host.conf and there is no delay. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=435261 User pbaudis@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=435261#c6 Petr Baudis <pbaudis@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW Info Provider|syseng@adnovum.ch | --- Comment #6 from Petr Baudis <pbaudis@novell.com> 2008-10-16 06:05:17 MDT --- SLES10SP1 does not support MDNS, I think. This is still a bug though since mdns ideally should kick in only from nss_dns so that the nsswitch order is respected. I currently cannot make this issue high priority for me, however, so I can't promise when will I get to fix it. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=435261 User mls@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=435261#c7 Michael Schröder <mls@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mls@novell.com --- Comment #7 from Michael Schröder <mls@novell.com> 2008-10-16 07:09:41 MDT --- That's not really correct. All of glibc's mdns lookup come from nss_dns, so the problem really isn't that the nss order isn't used. What's happening is that glibc first tries a IPv6 lookup. As there is no IPv6 match in /etc/hosts, the nss_dns module is asked which does a mdns lookup for the IPv6 address. After that request times out, an IPv4 lookup is tried which returns immediately, as /etc/hosts matches. (As a workaround we could disable IPv6 MDNS lookups in glibc's mdns code) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=435261 User syseng@adnovum.ch added comment https://bugzilla.novell.com/show_bug.cgi?id=435261#c8 --- Comment #8 from Bernd Nies <syseng@adnovum.ch> 2008-10-16 07:32:46 MDT --- For 10 years I hear people talking about IPv6. I've never seen someone using it in a productive environment. ;-) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=435261 Petr Baudis <pbaudis@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|Major |Normal Priority|P3 - Medium |P4 - Low -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com