For Windows computers that are connected to corporate networks - either physically via Ethernet or via Wi-Fi/VPN, I've noticed that the machine is aware of the domain of the network. As an example, if connected directly in the System Tray it may say something along the lines of "example.com Internet Access".
How does Windows know when its connected to the domain in this way - how does it associate the network that it's connected to with the "example.com" hostname?