Link to home
Start Free TrialLog in
Avatar of JimNadeau
JimNadeau

asked on

openSUSE 11.0 nslookup works ping does not

I have an openSUSE 11.0 box that can not resolve url addresses for xxxxxx.local domain with ping, but can do a nslookup. The box can ping url addresses that are external to the domain no problem:
suserad:/etc # ping www.google.com
PING www.l.google.com (74.125.93.104) 56(84) bytes of data.
64 bytes from qw-in-f104.google.com (74.125.93.104): icmp_seq=1 ttl=246 time=39.1 ms
64 bytes from qw-in-f104.google.com (74.125.93.104): icmp_seq=2 ttl=246 time=88.1 ms
64 bytes from qw-in-f104.google.com (74.125.93.104): icmp_seq=3 ttl=246 time=40.1 ms
suserad:/etc # nslookup mail02
Server:         192.168.1.7
Address:        192.168.1.7#53

Name:   mail02.precision.local
Address: 192.168.1.8

suserad:/etc # ping mail02
ping: unknown host mail02
Avatar of Morne Lategan
Morne Lategan
Flag of South Africa image

Can you post your /etc/resolv.conf file, your /etc/nsswitch file and your /etc/hosts file, please?
Also the output of hostname -f
Avatar of JimNadeau
JimNadeau

ASKER

suserad:/etc # cat resolv.conf
### BEGIN INFO
#
#
### END INFO
#
nameserver 192.168.1.7
nameserver 192.168.1.6
search precision.local
suserad:/ # hostname -f
suserad.workgroup
suserad:/ #
And nsswitch?
suserad:/etc # cat nsswitch.conf
#
# /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
#       nisplus                 Use NIS+ (NIS version 3)
#       nis                     Use NIS (NIS version 2), also called YP
#       dns                     Use DNS (Domain Name Service)
#       files                   Use the local files
#       [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: compat
group:  compat

hosts:          files mdns4_minimal [NOTFOUND=return] dns
networks:       files dns

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

bootparams:     files
automount:      files nis
aliases:        files


suserad:/etc # cat hosts
#
# hosts         This file describes a number of hostname-to-address
#               mappings for the TCP/IP subsystem.  It is mostly
#               used at boot time, when no name servers are running.
#               On small systems, this file can be used instead of a
#               "named" name server.
# Syntax:
#
# IP-Address  Full-Qualified-Hostname  Short-Hostname
#

127.0.0.1       localhost

# special IPv6 addresses
::1             localhost ipv6-localhost ipv6-loopback

fe00::0         ipv6-localnet

ff00::0         ipv6-mcastprefix
ff02::1         ipv6-allnodes
ff02::2         ipv6-allrouters
ff02::3         ipv6-allhosts
127.0.0.2       suserad.workgroup suserad
192.168.0.5     suserad suserad
suserad:/etc #
127.0.0.2       suserad.workgroup suserad
192.168.0.5     suserad suserad

Change that in hosts to read only:

192.168.0.5  suserad.workgroup suserad

Hash out the 127 line.

Also try changing the line in nsswitch:

hosts:          files mdns4_minimal [NOTFOUND=return] dns

To just:

hosts:          files dns

for a test.
I thing nslookup uses /etc/resolv.conf directly, and ping uses the specification in /etc/nsswitch, so it will check:

1) files: /etc/hosts
2) mdns4_minimal <- which i suspect is failing
3) dns
Nope:
suserad:/etc # nslookup mail02
Server:         192.168.1.7
Address:        192.168.1.7#53

Name:   mail02.precision.local
Address: 192.168.1.8

suserad:/etc # ping mail02
ping: unknown host mail02


Would a reboot be required?
nmap works with by hostname.
I don't think so, unless you have a resolver cache. Try logging out, and back in again. If all else fails, reboot and test it again.
/etc/init.d/nscd restart
Still no go. Just in case I tried ping mail02.precision.local to see if that would help, and it did not.
suserad:/etc # ping mail02
ping: unknown host mail02
suserad:/etc # ping mail02.precision.local
ping: unknown host mail02.precision.local
and if you say:

getent hosts mail02
getent hosts mail02.precision.local

What does it reply with?
Also change:

networks:       files dns

to just:

networks:       files
getent hosts does not return anything:
suserad:/etc # getent hosts mail02
suserad:/etc # getent hosts mail02.precision.local
suserad:/etc #

Updated the nsswitch.conf so networks would just read files and still nothing.
I'm reading up on this, but it would appear that the linux resolver libraries does not like the domain .local on suse...


ASKER CERTIFIED SOLUTION
Avatar of Morne Lategan
Morne Lategan
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Nice Find!
I put the nsswitch.conf back, and added the mdns off to the host.conf and bingo

suserad:/etc # vi nsswitch.conf
suserad:/etc # vi host.conf
suserad:/etc # init.d/nscd restart
Shutting down Name Service Cache Daemon                               done
Starting Name Service Cache Daemon                                    done
suserad:/etc # ping mail02
PING mail02.precision.local (192.168.1.8) 56(84) bytes of data.
64 bytes from mail02.precision.local (192.168.1.8): icmp_seq=1 ttl=127 time=2.88 ms
64 bytes from mail02.precision.local (192.168.1.8): icmp_seq=2 ttl=127 time=0.331 ms
64 bytes from mail02.precision.local (192.168.1.8): icmp_seq=3 ttl=127 time=0.301 ms
64 bytes from mail02.precision.local (192.168.1.8): icmp_seq=4 ttl=127 time=0.287 ms

In openSUSE 11.0 I could not find the nss_mdns.conf in the ect directory, but it is working.
Note my sarcasm: I LOVE Suse :) Glad it worked.