How does Windows automatically name a network?

4

Under certain circumstances, Windows is able to automatically give a Network it is connected to a name instead of naming it generically Network 1, Network 2, etc..

For wireless connections it seems to simply take the SSID of the network.

For wired connections it looks like it takes some information it gets via DHCP and (reverse?) DNS lookups. I have seen this work on networks with simple consumer level routers, but have not been able to get it to work with a custom Linux DHCP/DNS server.

What information does Windows need exactly to find this name automatically?

Addendum 1

I just checked and retried my setup and still get the same behavior.

My DHCP and DNS is provided by dnsmasq on an Ubuntu box. The dnsmasq configuration contains:

domain = office.example.com
dhcp-range=192.168.0.100,192.168.0.200,12h

For testing purposes, I also added fixed DNS names for DHCP clients (which didn't change anything regarding my question) in the hosts file for DNS:

192.168.0.100 dhcp-client100.office.example.com       dhcp-client100

This data also comes up in my lease on my Ubuntu box:

lease {
  interface "eth0";
  fixed-address 192.168.0.120;
[snip...]
  option host-name "dhcp-client120";
  option domain-name "office.example.com";
[snip...]
}

As well as a Windows box:

Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . : office.example.com
   Description . . . . . . . . . . . : Intel(R) PRO/1000 MT Desktop Adapter
[snip...]
   DHCP Enabled. . . . . . . . . . . : Yes
[snip...]
   IPv4 Address. . . . . . . . . . . : 192.168.0.145(Preferred)
[snip...]

But still, when the Windows box connects to the network for the first time, the label for the network name changes from Identifying... over Unidentified Network to Network 1, and not to office.example.com.

Both boxes are are to forward and reverse look up their IP and host name.

Hurzelchen

Posted 2015-04-10T11:42:20.763

Reputation: 216

What do you mean how? The first network it finds is Network 1, the next is Network 2, you can change the name of these networks if you want of course. It keeps tracks of any network you ever connected to in the registry. What problem are you actually trying to solve? – Ramhound – 2015-04-10T11:45:59.160

@Ramhound: It can go beyond "Network X". – user1686 – 2015-04-10T11:51:21.387

@grawity - I know that. I am just not sure what the author's question is exactly. – Ramhound – 2015-04-10T11:53:57.693

On a domain network, it seems to take the name of the domain itself. At home, it seems to me that it takes the name it assigns the network connection (e.g. at home mine is just Ethernet). I have two wired network adapters on my home computer and it named them Ethernet 1 and Ethernet 2. This is in Win 8.1. – trpt4him – 2015-04-10T13:01:11.570

@trpt4him at my home, I have a FIRTZ!Box router, which uses fritz.box as its domain. And my windows machine at home also shows fritz.box as network name. – Hurzelchen – 2015-04-10T13:20:47.943

Interesting. Maybe it uses WINS? Not sure if WINS is enabled by default in dnsmasq. – trpt4him – 2015-04-10T13:26:26.183

I'll check, as soon as I get there. – Hurzelchen – 2015-04-10T13:29:10.027

Answers

0

Not sure about the complete list, but I have seen it use the DHCP "domain name" option this way. The ISC dhcpd syntax would be:

option domain-name "example.com";

user1686

Posted 2015-04-10T11:42:20.763

Reputation: 283 655

that alone doesn't seem to do the trick... – Hurzelchen – 2015-04-10T13:22:19.407