Resolving Windows Hostnames from a Linux Client

Posted on 2004-10-06
Medium Priority
Last Modified: 2010-03-18
So far my new attempt at Linux is mostly working, except for two problems (the other of which I just posted (Connecting through Samba to a Windows Share past XP's SP2 firewall)

From my Linux box (Fedora Core 2) I can see each of the other systems on the LAN through Konqueror's LAN Browser (Is their a better way? Yet to find one...)  The only problem is that they all come up as IP addresses insted of Hostnames. I can ping by IP, but not by name.

All of the systems in the network have their IP's assigned by DHCP from my DSL router. And I don't want to assign static IP's to each system. Freinds come over and plug in, systems come and go, it all needs to be seamless.

Through Windows everything works perfectly, I plug a windows box into my network and it can see and access all shares and systems by name, without a system acting as a DNS server. Then Linux comes along, and after much googling, and a visit to some of the Linux Forums, I'm told my options are to either:

Set every system a static IP and list them all in /etc/resolv.conf As I'm sure you'll agree this isn't practical.


Set up one of the systems as a DNS server to take care of all that, which _could_ be done, but I'd really rather not if I can avoid it. None of the systems have roles where they should be left on all the time, and I'd like to keep it that way.

This is a peer to peer home LAN, I have no need for a central server (inspite of the fun value) and it needs to work without reconfiguring every new system that trys to plug in, all I'm trying to do is get Linux to play nice with my Windows network, so I can set about finally learning how to use it.

Is their a solution that fits what I'm looking for, or am I going to have to set up a server?

Question by:akshoslaa
  • 3
  • 3
LVL 19

Accepted Solution

Gabriel Orozco earned 1000 total points
ID: 12239595
use freshmeat sute to look for apps that can help you to have a better experience:

there, you can look for smb browsers, where I found these:
smb4k (for KDE) http://freshmeat.net/projects/smb4k/
smb web client  http://freshmeat.net/projects/smbwebclient/
nmb scan (this is for the shell and it scans all names) http://freshmeat.net/projects/nmbscan/
jFTP (uses a ftp like protocol for many types of servers, like smb, ftp, nfs, http, etc) http://freshmeat.net/projects/jftp/

you can find a lot more searching for the word "smb"

and of course, looking for names, not ip's.

Author Comment

ID: 12245279

gave nmbscan a try, but like with most linux apps I've come accross it expects me in instinctively know what I'm doing, as such I can't do a damn thing with it... and the developers website is no better.

smb4k works, quite well I might add... it manages to retrieve all the hostnames, and display a list of their shares (inspite of half the network being behind SP2 firewalls that prevent me from viewing them normally.) However, it wont mount the shares, giving me an error about "smbmount must be installed suid root for direct user mounts"

Checked the developers homepage, and in their FAQ was the exact problem, with two solutions...

1) chmod -s /usr/bin/smbmount
did that:
ls -l /usr/bin/smbmount
-rwsr-sr-x  1 akshoslaa root  664508 Sep 14 03:05 /usr/bin/smbmount

it made no difference.

2) under superuser/shares check the super user box
I would but it's greyed out...

I'll keep looking though... *puts on his determined face*

Author Comment

ID: 12245308
Ah... whoops :P
chmod +s smbmnt

my mistake... still doesn't work, but at least I have one less problem now...
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

LVL 19

Expert Comment

by:Gabriel Orozco
ID: 12245863
if you want to mount shares, do it as root.

Expert Comment

ID: 12258647
You can have DHCP server configured on your linux system rather than on DSL router.

Author Comment

ID: 12258804
>You can have DHCP server configured on your linux system rather than on DSL router.

Except that would mean having the linux system on _all_ the time... I'd like to avoid that. It's there for me to tinker with and break and fix and generally learn from. Probly not a good idea for the network to rely on it :P

How is it that windows systems can all see each others hostnames without a specific server to tell them? I've been told it's WINS ... My /etc/samba/smb.conf file contains the following:

# All NetBIOS names must be resolved to IP Addresses
# 'Name Resolve Order' allows the named resolution mechanism to be specified
# the default order is "host lmhosts wins bcast". "host" means use the unix
# system gethostbyname() function call that will use either /etc/hosts OR
# DNS or NIS depending on the settings of /etc/host.config, /etc/nsswitch.conf
# and the /etc/resolv.conf file. "host" therefore is system configuration
# dependant. This parameter is most often of use to prevent DNS lookups
# in order to resolve NetBIOS names to IP Addresses. Use with care!
# The example below excludes use of name resolution for machines that are NOT
# on the local network segment
# - OR - are not deliberately to be known via lmhosts or via WINS.
; name resolve order = wins lmhosts bcast

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
   wins support = yes

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
#      Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
;   wins server = w.x.y.z

# WINS Proxy - Tells Samba to answer name resolution queries on
# behalf of a non WINS capable client, for this to work there must be
# at least one      WINS Server on the network. The default is NO.
;   wins proxy = yes

The only change I've made was to revove the semi-colon before wins support = yes (as was suggested by several samba howto's on the net)
Unfortunately it's made absolutely no difference... and as yet I don't know nearly enough about linux to be able to fiddle with the others and see what they do... any suggestions?
LVL 19

Expert Comment

by:Gabriel Orozco
ID: 12260860

maybe it is because all the clients must be configured to have the ip of your linux box as wins server...

do that and you will begin to see the difference.

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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…
Did you know PowerShell can save you time with SaaS platforms? Simply leverage RESTfulAPIs to build your own PowerShell modules. These will kill repetitive tickets and tabs, using the command Invoke-RestMethod. Tune into this webinar to learn how…

589 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