# Why can't I mount a win host by name (\\\\hostname) but can by ip (\\\\192.x.x.x)?

**URL:** https://boards.straightdope.com/t/why-cant-i-mount-a-win-host-by-name-hostname-but-can-by-ip-192-x-x-x/492501
**Category:** Factual Questions
**Created:** [April 9, 2009, 1:43pm UTC](https://boards.straightdope.com/t/why-cant-i-mount-a-win-host-by-name-hostname-but-can-by-ip-192-x-x-x/492501 "2009-04-09T13:43:38Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![filmore](https://avatars.discourse-cdn.com/v4/letter/f/7993a0/32.png) [@filmore](https://boards.straightdope.com/u/filmore)
#### Post date: [April 9, 2009, 1:43pm UTC](https://boards.straightdope.com/t/why-cant-i-mount-a-win-host-by-name-hostname-but-can-by-ip-192-x-x-x/492501/1 "2009-04-09T13:43:38Z")

</div>

I have this problem all the time on my home network. Sometimes I can connect to systems using their name like this \hostname. However, sometimes that doesn’t work. When it fails, I can connect if I use the IP address like this \192.168.0.10. This causes issues with trying to access remote storage and printers since usually I have it configured as \hostname\printer.

Both systems are Win XP and they are both in the same workgroup (MSHOME). They are hard-wired to the same router.

Something interesting is that when I do a Start-\>Run and enter the \ipaddress, the resulting window that comes up has the title:

```
 Hostname (ipaddress)

```

So somehow the hostname is associated with the address.

When I try to connect using \hostname, the error that comes back is:

```
Windows cannot find '\\hostname'. Check the spelling and try again,
 or try searching for the item by clicking the Start button and then
clicking Search.

```

Any ideas on how I can debug this?

---

<div class="post-metadata">

### Author: ![HorseloverFat](https://avatars.discourse-cdn.com/v4/letter/h/8e8cbc/32.png) [@HorseloverFat](https://boards.straightdope.com/u/HorseloverFat)
#### Post date: [April 9, 2009, 1:46pm UTC](https://boards.straightdope.com/t/why-cant-i-mount-a-win-host-by-name-hostname-but-can-by-ip-192-x-x-x/492501/2 "2009-04-09T13:46:28Z")

</div>

On your network youre using netbios name resolution to resolve hostnames. Its an uncentralized approach to name resolution and makes a random computer on the network a master browser. This computer could have been a laptop that was shut off. Ideally you want a 24/7 machine on the network for netbios to work properly.

On top of that netbios resolution only works through broadcast packets. If your router or anything on your network is filtering these packets or if your network is losing packets (common in wireless) then netbios wont work at all or will work sporadically.

---

<div class="post-metadata">

### Author: ![Bricker](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@Bricker](https://boards.straightdope.com/u/Bricker)
#### Post date: [April 9, 2009, 1:59pm UTC](https://boards.straightdope.com/t/why-cant-i-mount-a-win-host-by-name-hostname-but-can-by-ip-192-x-x-x/492501/3 "2009-04-09T13:59:43Z")

</div>

> [@HorseloverFat](#):
>
> On your network youre using netbios name resolution to resolve hostnames. Its an uncentralized approach to name resolution and makes a random computer on the network a master browser. This computer could have been a laptop that was shut off. Ideally you want a 24/7 machine on the network for netbios to work properly.
> 
> On top of that netbios resolution only works through broadcast packets. If your router or anything on your network is filtering these packets or if your network is losing packets (common in wireless) then netbios wont work at all or will work sporadically.

Well, to be a bit nitpicky, it’s not “random;” master browser elections follow a pretty well-defined set of rules, starting with preference to higher versions of the OS and ending with the server with the lexically lowest name winning. And one event that forces an election datagram to be broadcast is when the sending computer can’t locate a master browser… which sort of suggests that the laptop that’s been turned off isn’t going to be an MB for too long. The only random event is the delay, after a won election, for sending out another election datagram.

But your basic thrust I agree with: it’s a netbios issue. If we have a problem with smb://_hostname_ and we replace _hostname_ with an FQDN (and that FQDN resolves correctly) then that should work just as well as an IP address.

---

<div class="post-metadata">

### Author: ![GSV\_Consolation\_of\_Dreams](https://avatars.discourse-cdn.com/v4/letter/g/f1d935/32.png) [@GSV\_Consolation\_of\_Dreams](https://boards.straightdope.com/u/GSV_Consolation_of_Dreams)
#### Post date: [April 9, 2009, 2:40pm UTC](https://boards.straightdope.com/t/why-cant-i-mount-a-win-host-by-name-hostname-but-can-by-ip-192-x-x-x/492501/4 "2009-04-09T14:40:53Z")

</div>

If this is a small network with statically assigned IPs you could edit your lmhosts file in C:\Windows\system32\drivers\etc to manually map the IPs to hostnames.

---

<div class="post-metadata">

### Author: ![GSV\_Consolation\_of\_Dreams](https://avatars.discourse-cdn.com/v4/letter/g/f1d935/32.png) [@GSV\_Consolation\_of\_Dreams](https://boards.straightdope.com/u/GSV_Consolation_of_Dreams)
#### Post date: [April 9, 2009, 2:46pm UTC](https://boards.straightdope.com/t/why-cant-i-mount-a-win-host-by-name-hostname-but-can-by-ip-192-x-x-x/492501/5 "2009-04-09T14:46:37Z")

</div>

Drat, missed the edit window:

If it doesn’t work after a reboot, you may have lmhosts lookup disabled in the advanced TCP/IP properties of your network connection.

---

<div class="post-metadata">

### Author: ![HorseloverFat](https://avatars.discourse-cdn.com/v4/letter/h/8e8cbc/32.png) [@HorseloverFat](https://boards.straightdope.com/u/HorseloverFat)
#### Post date: [April 9, 2009, 3:29pm UTC](https://boards.straightdope.com/t/why-cant-i-mount-a-win-host-by-name-hostname-but-can-by-ip-192-x-x-x/492501/6 "2009-04-09T15:29:07Z")

</div>

Yeah, I know its not random, but for the end user it might as well be. Not to mention the subtleties of netbios elections might be a bit out of scope for this question.

---

<div class="post-metadata">

### Author: ![Reply](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/reply/32/15952_2.png) [@Reply](https://boards.straightdope.com/u/Reply)
#### Post date: [April 9, 2009, 3:40pm UTC](https://boards.straightdope.com/t/why-cant-i-mount-a-win-host-by-name-hostname-but-can-by-ip-192-x-x-x/492501/7 "2009-04-09T15:40:29Z")

</div>

Fascinating. I’ve always wondered about this.

So is it possible to _force_ a particular, always-on machine to act as the preferred name server (or a “master browser”, I guess the term would be)?

And in the context of a local network, what would a FQDN be? I thought that only applied to the Internet and DNS, or am I mistaken?

---

<div class="post-metadata">

### Author: ![filmore](https://avatars.discourse-cdn.com/v4/letter/f/7993a0/32.png) [@filmore](https://boards.straightdope.com/u/filmore)
#### Post date: [April 9, 2009, 3:46pm UTC](https://boards.straightdope.com/t/why-cant-i-mount-a-win-host-by-name-hostname-but-can-by-ip-192-x-x-x/492501/8 "2009-04-09T15:46:43Z")

</div>

Now that it’s been mentioned, I do think rebooting may be part of the problem. It usually is after some system has been rebooted that I start seeing the problem. I assume that the problem is when I reboot the master and it loses any info it had about the other hosts. Is there a way to have a failing host re-broadcast it’s name?

> [@GSV\_Consolation\_of\_Dreams](#):
>
> If this is a small network with statically assigned IPs you could edit your lmhosts file in C:\Windows\system32\drivers\etc to manually map the IPs to hostnames.

Interesting. I hadn’t thought of doing this. I’ll give it a try.

---

<div class="post-metadata">

### Author: ![Bricker](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@Bricker](https://boards.straightdope.com/u/Bricker)
#### Post date: [April 9, 2009, 4:28pm UTC](https://boards.straightdope.com/t/why-cant-i-mount-a-win-host-by-name-hostname-but-can-by-ip-192-x-x-x/492501/9 "2009-04-09T16:28:03Z")

</div>

> [@Reply](#):
>
> Fascinating. I’ve always wondered about this.
> 
> So is it possible to _force_ a particular, always-on machine to act as the preferred name server (or a “master browser”, I guess the term would be)?

Yes. Usual caveats about using REGEDIT, but if you have a preferred candidate for the job, set HKEY\_LOCAL\_MACHINE\SYSTEM\CurrentControlSet\Services\Browser\Parameters\IsDomainMaster to TRUE.

> [@](#):
>
> And in the context of a local network, what would a FQDN be? I thought that only applied to the Internet and DNS, or am I mistaken?

Sure, a local network can have a FQDN. It might be a tad unusual for a home system, but not unheard of – I have a local AD domain in my house, as well as Linux boxes that authenticate using LDAP. So my DC’s are authoritive for my local DNS zones, and I have FQDN’s that don’t exist outside my house but are fully resolvable and reachable internally.

---

<div class="post-metadata">

### Author: ![Reply](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/reply/32/15952_2.png) [@Reply](https://boards.straightdope.com/u/Reply)
#### Post date: [April 9, 2009, 4:33pm UTC](https://boards.straightdope.com/t/why-cant-i-mount-a-win-host-by-name-hostname-but-can-by-ip-192-x-x-x/492501/10 "2009-04-09T16:33:03Z")

</div>

> [@Bricker](#):
>
> Yes. Usual caveats about using REGEDIT, but if you have a preferred candidate for the job, set HKEY\_LOCAL\_MACHINE\SYSTEM\CurrentControlSet\Services\Browser\Parameters\IsDomainMaster to TRUE.

Neat. Thank you. What happens if 2+ machines all have that set?

> [@](#):
>
> Sure, a local network can have a FQDN. It might be a tad unusual for a home system, but not unheard of – I have a local AD domain in my house, as well as Linux boxes that authenticate using LDAP. So my DC’s are authoritive for my local DNS zones, and I have FQDN’s that don’t exist outside my house but are fully resolvable and reachable internally.

Ahh, ok. Is something similar available via regular ol’ Windows Home Networking?

---

<div class="post-metadata">

### Author: ![Bricker](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@Bricker](https://boards.straightdope.com/u/Bricker)
#### Post date: [April 9, 2009, 5:43pm UTC](https://boards.straightdope.com/t/why-cant-i-mount-a-win-host-by-name-hostname-but-can-by-ip-192-x-x-x/492501/11 "2009-04-09T17:43:42Z")

</div>

> [@Reply](#):
>
> Neat. Thank you. What happens if 2+ machines all have that set?

If there’s a tie in one set of criteria, the competing machines move on to the next set of criteria. Ultimately, as I mentioned above, a machine named “DownstairsLap” will win over a machine named “UpstairsPC” if all other criteria tie, because ‘D’ is alphabetically before ‘U.’

> [@](#):
>
> Ahh, ok. Is something similar available via regular ol’ Windows Home Networking?

Host files. 🙂
