Redhat Linux 9 and Windows XP name resolution issue

Hi,

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, 192.168.100.2 is it's ip address (static).
redhat is the name of the Linux box, 192.168.100.13 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 192.168.100.255
192.168.100.2 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=192.168.100.13 bcast=192.168.100.255 nmask=255.255.255.0
Got a positive name query response from 127.0.0.1 (192.168.100.2)
Password:

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.
ram360cidAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BarthaxCommented:
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.
0
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.
0
wesly_chenCommented:
>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.

Regards,

Wesly
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BarthaxCommented:
Thanks for helping me learn something too. :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.