Linux can see the hostname, but Windows can’t see it

Posted on

QUESTION :

I’m getting everything set up for a LAN party, and would like connecting to the server as easy as possible. There will be both Linux and Windows computers at this party, so it needs to be compatible with both OSes on the network level. I don’t want to have to go into each of my guest’s computers and change a setting.

What I’m trying to do is, using a DD-WRT router, make the server accessible under the hostname Galadhriel-Server. Here’s the entry information:

MAC Address: 08:00:27:0d:29:e7
Host Name: Galadhriel-Server
IP Address: 192.168.1.2
Client Lease Time: 1500

The router can confirm that Galadhriel-Server is connected on the IP Address above using DHCP, and pings from other Linux machines work as well. I can also connect to Galadhriel-Server using a web browser on Linux.

Windows, on the other hand, refuses to connect unless I type in the IP address saying that the server cannot be found.

Connection information given by Windows:

IPv4 Address: 192.168.1.52
IPv4 Subnet Mask: 255.255.255.0
IPv4 Default Gateway: 192.168.1.1
IPv4 DHCP Server: 192.168.1.1
IPv4 DNS Server: 192.168.1.1

Connection information given by a Linux Machine:

ubuntu@ubuntu:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:c8:f7:ff  
          inet addr:192.168.1.57  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fec8:f7ff/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2461 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1553 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1734014 (1.7 MB)  TX bytes:133134 (133.1 KB)

Connection information given by Galadhriel-Server:

david@Galadhriel-Server:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:0d:29:e7  
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe0d:29e7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1654 errors:0 dropped:0 overruns:0 frame:0
          TX packets:503 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:167251 (167.2 KB)  TX bytes:73760 (73.7 KB)

Thank you for the help!

ANSWER :

In order for the computers to resolve DNS host names via DNS they all need to be configured with the same DNS suffix and they all need to be configured to use the same DNS server that hosts a zone file for that DNS suffix. The DNS “server” on your router is nothing more than a DNS forwarder/resolver. It does not host any DNS zones in which your LAN clients can register their A records and resolve the A records of other LAN clients.

Windows Vista/7/8 clients should be able to resolve the names of other Windows Vista/7/8 clients via LLMNR if DNS name resolution isn’t available, so long as Network Discovery is enabled.

For Windows clients running Windows XP and earlier they should be able to resolve the names of other Windows clients via NetBIOS name resolution.

You haven’t given too many details regarding your LAN, so it is hard to say exactly what it is that is going on. However, having experience in that department (having mixed Linux, Mac OS, and Windows machines on the same LAN), it is best if you have all machines on the same subnet and that all machines have the same Workgroup and/or Domain name, including the Linux machines.

You will need to set that Workgroup or Domain name in Samba (make sure Samba and winbind, and all other dependencies are installed on the server and Linux machines). Then, make sure that all Windows machines have the same Workgroup and/or Domain name as the one you set for the server. Also make sure that the server or at least one Windows machine is the ‘master browser.’

Usually, that all should be enough to bring everything together. It does, at least, for me. Hopefully, it will for you.

Updated:

It came to my attention that some systems may not have Samba configured correctly for all the computers to see each other. So I am adding the following.

If you still cannot see the linux machine and the linux machine cannot browse the Windows network, check to be sure that the following are in the global section of your /etc/samba/smb.conf file (putting in your own names for workgroup and hostname and without the angle brackets):

workgroup = <workgroup>
netbios name = <hostname>
name resolve order = bcast host

Save the file and then issue the following commands (they may vary according to your version and distribution of Linux):

sudo service nmbd restart
sudo service smbd restart

That should fix that browsing problem if your configuration is lacking the proper settings.

Leave a Reply

Your email address will not be published.