Link to home
Start Free TrialLog in
Avatar of ram360cid
ram360cid

asked on

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.
Avatar of Barthax
Barthax
Flag of United Kingdom of Great Britain and Northern Ireland image

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.
Avatar of ram360cid
ram360cid

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of wesly_chen
wesly_chen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for helping me learn something too. :)