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

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

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.
0
ram360cid
Asked:
ram360cid
  • 2
1 Solution
 
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
 
BarthaxCommented:
Thanks for helping me learn something too. :)
0

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