Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 274
  • Last Modified:

Redhat Linux 9 and Windows XP name resolution issue


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.
  • 2
1 Solution
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.
ram360cidAuthor Commented:
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.
>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.


Thanks for helping me learn something too. :)

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now