Redhat Linux 9 and Windows XP name resolution issue

Posted on 2005-03-07
Medium Priority
Last Modified: 2010-03-18

I have a Red Hat 9 Linux box setup as a WINS server.  I have the following 2 lines in my /etc/samba/smb.conf file global section:

wins support = yes
name resolve order = wins hosts lmhosts bcast

I also have a Windows XP Prof machine with its WINS entry the ip address of the Red Hat box.

Problem....I cannot ping XP from Linux.  I get the following error:

ping: unknown host office

office is the name of the XP machine, is it's ip address (static).
redhat is the name of the Linux box, is it's ip address (static).
I can ping Linux from XP, however.
I can perform an nmblookup for the machine names (on the linux box) and it seems to work, here are the results:

nmblookup office
querying office on office<00>

Network settings seem to be ok on the Linux box.  I can access the internet on both machines.  I can also access shares on both machines.  For example, the following command work fine:

smbclient -L office
added interface ip= bcast= nmask=
Got a positive name query response from (

I then type in the password and it shows me all the shares for "office" i.e. Windows XP machine.

The Redhat box can also ping itself fine and google.com fine.

I have spent some time on this.  Please help.
Question by:ram360cid
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
  • 2
LVL 19

Expert Comment

ID: 13476456
Sounds like you name resolution order on your Linux box does not include the wins. Linux box will have nothing to do with wins - wins is a primarily a MS protocol.  If this is the only shortcoming of your set up and you do not plan to expand the network much further, I would simply make an alteration to the /etc/hosts file on the Linux box to include the IP address & name of the XP machine.  Basically, the Linux box expects to find everything through DNS.  If you really need this to work through Samba, then I would point you in the direction of the Samba HOWTO: http://us1.samba.org/samba/docs/man/Samba-HOWTO-Collection/ - there's a lot of stuff to sift through.  Alternatively http://www.linuxhomenetworking.com/linux-hn/samba.htm for a specific section on Windows, Linux & Samba.

Author Comment

ID: 13477192
Thanks, but your info doesn't help.

I found the solution, not sure I understand it though.

Seems I had to modify the following to my /etc/nsswitch.conf file:

Old entry:
hosts:      dns files

New entry:
hosts:      wins dns files

After I did that, it worked fine.  I don't understand why I have to specify "wins" in 2 different files i.e. smb.conf and nsswitch.conf.

The more I think about this, nsswitch.conf must be for the OS name resolution i.e. "ping" etc.
Then smb.conf is just for samba name resolution i.e. "smbclient" etc.
LVL 38

Accepted Solution

wesly_chen earned 1000 total points
ID: 13482360
>hosts:      wins dns files
Unix/Linux check the nsswitch.conf to pick which name resolution service to use first.
In your case, it checks "wins" first. If the host name is not in wins, then it will check "dns" then /etc/hosts (files).

As for "wins support = yes" in smb.conf, it set your SAMBA server as WINS server.
Besides, "name resolve order = wins hosts lmhosts bcast" in smb.conf is for SAMBA only, say,
smbclient //<Windows>/<shared folder>
Not for ping or other network application, which use /etc/nsswitch.conf.

I recommend that you use DNS instead of WINS since WINS is not reliable.
Also, use
hosts:      files dns wins
in /etc/nsswitch.conf, put wins at the end.


LVL 19

Expert Comment

ID: 13484166
Thanks for helping me learn something too. :)

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses
Course of the Month9 days, 23 hours left to enroll

762 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