Solved

openSUSE 11.0 nslookup works ping does not

Posted on 2009-03-30
21
1,222 Views
Last Modified: 2012-05-06
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
0
Comment
Question by:JimNadeau
  • 14
  • 7
21 Comments
 
LVL 7

Expert Comment

by:Morne Lategan
ID: 24021841
Can you post your /etc/resolv.conf file, your /etc/nsswitch file and your /etc/hosts file, please?
0
 
LVL 7

Expert Comment

by:Morne Lategan
ID: 24021849
Also the output of hostname -f
0
 

Author Comment

by:JimNadeau
ID: 24022104
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:/ #
0
 
LVL 7

Expert Comment

by:Morne Lategan
ID: 24022420
And nsswitch?
0
 

Author Comment

by:JimNadeau
ID: 24022455
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 #
0
 
LVL 7

Expert Comment

by:Morne Lategan
ID: 24022501
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.
0
 
LVL 7

Expert Comment

by:Morne Lategan
ID: 24022555
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
0
 

Author Comment

by:JimNadeau
ID: 24022645
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?
0
 

Author Comment

by:JimNadeau
ID: 24022676
nmap works with by hostname.
0
 
LVL 7

Expert Comment

by:Morne Lategan
ID: 24022682
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.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 7

Expert Comment

by:Morne Lategan
ID: 24022706
/etc/init.d/nscd restart
0
 

Author Comment

by:JimNadeau
ID: 24022762
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
0
 
LVL 7

Expert Comment

by:Morne Lategan
ID: 24022784
and if you say:

getent hosts mail02
getent hosts mail02.precision.local

What does it reply with?
0
 
LVL 7

Expert Comment

by:Morne Lategan
ID: 24022809
Also change:

networks:       files dns

to just:

networks:       files
0
 

Author Comment

by:JimNadeau
ID: 24022872
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.
0
 
LVL 7

Expert Comment

by:Morne Lategan
ID: 24023047
I'm reading up on this, but it would appear that the linux resolver libraries does not like the domain .local on suse...


0
 
LVL 7

Accepted Solution

by:
Morne Lategan earned 500 total points
ID: 24023111
from here:

http://www.novell.com/coolsolutions/tip/15248.html

It seems:

"you will need to edit the /etc/host.conf file. There you will need to add the parameter

mdns off

to the bottom of the file."

0
 
LVL 7

Expert Comment

by:Morne Lategan
ID: 24023143
0
 
LVL 7

Expert Comment

by:Morne Lategan
ID: 24023188
0
 

Author Comment

by:JimNadeau
ID: 24023283
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.
0
 
LVL 7

Expert Comment

by:Morne Lategan
ID: 24023334
Note my sarcasm: I LOVE Suse :) Glad it worked.
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now