Jump to content

DNS Hostnames in Windows Network Neighborhood


j7n

Recommended Posts

Ever since I rebooted my always on Windows XP PC, it disappeared from the Windows Network under the hostname I had previously assigned to it. It has likely to do with a setting on the PC itself, which I adjusted days before taking the computer offline. I have some "SMB" shares accessed from this PC by the name, which are now invalid.

The Windows Network has a mind of its own... It works without setting it up, and then stops working.

I would like to avoid this category of problems with Windows Netowork altogether, by switcing to DNS for name resolution. This should in theory allow me to move the PC elsewhere, change its IP, and still have the shares work fine. DNS is running on my router, which all computers use.

Problem: I cannot use the DNS hostname to open a network share at all. IP services like FTP are working fine. I can ping the host. I can use \\192.168.1.17 in the address bar to load the shares, but cannot use \\studijaex. I've also tried a multi-part hostname, and ending with a period.

network-neighborhood-dns.png

All computers are running Windows XP. \\hostname doesn't work on any of them.

Edited by j7n
Link to comment
Share on other sites


If I'm not mistaken, the hostname as used in that case is a NetBIOS name.

So we might need more information regarding the network topography. Is this a domain or a workgroup? What is the DHCP server? What is the DNS server?

Can you connect to the share by using \\192.168.1.17 ?

Link to comment
Share on other sites

Yes, I can connect using the IP address 192.168.1.17. Computers have static IP addresses; and belong to Workgroup "J7NH".

Computer A, connected to router's port 1, and has static address 192.168.1.17

C:\>ipconfig /allWindows IP Configuration        Host Name . . . . . . . . . . . . : studijaex        Primary Dns Suffix  . . . . . . . :        Node Type . . . . . . . . . . . . : Unknown        IP Routing Enabled. . . . . . . . : No        WINS Proxy Enabled. . . . . . . . : No        DNS Suffix Search List. . . . . . :Ethernet adapter Onboard Marvell Yukon:        Connection-specific DNS Suffix  . :        Description . . . . . . . . . . . : Marvell Yukon 88E8053 PCI-E GigabitEthernet Controller        Physical Address. . . . . . . . . : 00-16-E6-87-ED-4B        Dhcp Enabled. . . . . . . . . . . : No        IP Address. . . . . . . . . . . . : 192.168.1.17        Subnet Mask . . . . . . . . . . . : 255.255.255.0        Default Gateway . . . . . . . . . : 192.168.1.254        DNS Servers . . . . . . . . . . . : 192.168.1.254C:\>tracert 192.168.3.5Tracing route to b75m [192.168.3.5]over a maximum of 30 hops:  1    <1 ms     1 ms     1 ms  router.j7nh [192.168.1.254]  2     1 ms     1 ms     1 ms  b75m [192.168.3.5]Trace complete.
Computer B, connected to router's port 3, address given by DHCP 192.168.3.5

D:\Users\Administrator>ipconfig /allWindows IP Configuration        Host Name . . . . . . . . . . . . : B75M        Primary Dns Suffix  . . . . . . . :        Node Type . . . . . . . . . . . . : Unknown        IP Routing Enabled. . . . . . . . : No        WINS Proxy Enabled. . . . . . . . : No        DNS Suffix Search List. . . . . . :Ethernet adapter Local Area Connection:        Connection-specific DNS Suffix  . : j7nh        Description . . . . . . . . . . . : Realtek PCIe GBE Family Controller        Physical Address. . . . . . . . . : 94-DE-80-6D-7D-4A        Dhcp Enabled. . . . . . . . . . . : Yes        Autoconfiguration Enabled . . . . : Yes        IP Address. . . . . . . . . . . . : 192.168.3.5        Subnet Mask . . . . . . . . . . . : 255.255.255.0        Default Gateway . . . . . . . . . : 192.168.3.254        DHCP Server . . . . . . . . . . . : 192.168.3.254        DNS Servers . . . . . . . . . . . : 192.168.3.254        NetBIOS over Tcpip. . . . . . . . : Disabled        Lease Obtained. . . . . . . . . . : trediena, 2014. gada 12. februārī 19:09:14        Lease Expires . . . . . . . . . . : sestdiena, 2014. gada 22. februārī 19:09:14D:\Users\Administrator>tracert 192.168.1.17Tracing route to studijaex [192.168.1.17]over a maximum of 30 hops:  1     1 ms     1 ms    <1 ms  router.j7nh [192.168.3.254]  2     1 ms     1 ms     1 ms  studijaex [192.168.1.17]Trace complete.
I've entered hostnames into the router. They're used during ping ^, but cannot be used to access Network Shares (I previously assumed they were). I'd like to be able to open the remote computer by typing its name. Probably, until the reboot, it was the identical NetBIOS name that was used. And NetBIOS is no longer working.

"NetBIOS over TCP/IP" was Default on computer B, when the problem occurred. I set it to Disabled, thinking it would cause to prefer DNS. Doesn't work either way.

Link to comment
Share on other sites

Is there a reason why one is static and the other isn't? It would be preferrable to have both static. Or at least set a DHCP reservation for the one that isn't so that it always gets the same IP. Then what you can do is use the LMHOSTS file to set the names to IPs and NetBIOS should work better.

I am reading that resolution works as such:


  1. NetBIOS name cache
  2. WINS server
  3. B-node broadcast
  4. LMHOSTS file
  5. HOSTS file
  6. DNS server

http://support.microsoft.com/kb/142309

So right away you can see where a major problem can happen. If the first place to look is the local cache, and the destination PC is on a dynamic IP, then there is a good possibility that the IP is out of date in there. Also it seems that you could use either the HOSTS or LMHOSTS file to set your information but the LMHOSTS file was designed specifically for NetBIOS.

http://support.microsoft.com/kb/102725

If you want to clear out errorneous data in your NetBIOS cache you can use nbstat:

http://technet.microsoft.com/en-us/library/cc784285%28v=ws.10%29.aspx

Link to comment
Share on other sites

I have assigned the IP of "B" (the "client") via a static lease.

I created a LMHOSTS file (there was none except the sample) and entered the host name and ip there. This makes shares accessible under that name. I am still puzzled as to why everything worked without it before.

From another computer running Windows 2000 I can access \\studijaex without lmhosts. I created several A records on the DNS ("test1", "test2.j7nh", "test9"), all pointing at 192.168.1.17, and they all correctly open the network shares from the Windows 2000 computer, but neither of my two XP computers, nor in fact the "server" itself (also running XP).

Link to comment
Share on other sites

After directed to look at the NetBIOS name as a separate one, and at hosts files on the clients, I think I have figured out the problem.

The issue wasn't to do with name resolution at all, which worked correctly all the time. I used a packet sniffer to look at the connection. The "client" receives the correct IP address, establishes a connection to the Direct-SMB port 445, exchanges a few packets, and drops the connection.

The Windows 2000 computer which worked, used NetBIOS over TCP ports 137-139 to connection to the shares, and did not use port 445 at all. Windows 2000 and XP can be configured to use NetBIOS, by setting SMBDeviceEnabled to 0, but will default to Direct-SMB. I did enable SMB a few weeks ago, and forgot about it. That was a bad decision.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters\SMBDeviceEnabled
Somehow the NetBIOS "computer name" of my "server" was set to "17-studijaex", different from what I had in the DNS. Apparently Windows shares only respond to their own hostname, kinda like a vhost in a webserver. I replaced all references of this old name, restarted the computer, and now DirectSMB also works.

To make sure, I forwarded port 445 for a single host on the Internet and tried accessing the shares in three ways:

by Internet IP - works

by j7n.....hostname for the same IP - failure

by "studijaex" added to hosts file - works

I didn't have a DNS server there to test; but it would would probably work too. This name matching doesn't serve any purpose for security, but that is how it is.

1) NetBIOS over TCP/IP - enabled for the network connection - SMBDeviceEnabled = 0

Works over LAN with any hostname.

2) Direct-SMB - SMBDeviceEnabled = 1 - NetBIOS can be disabled

Works over LAN or the Internet if the hostname matches the remote computer name.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...