Solved

openSUSE 11.0 nslookup works ping does not

Posted on 2009-03-30
21
1,235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
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
 
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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

739 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