Windows Server networking basics

More Windows Server problems turn out to be network problems than anything else. When someone says “AD is broken” it’s usually DNS, and “the app is down” is often a firewall rule. Good Windows Server networking basics let you prove where the problem is with a few commands, instead of guessing.

We’ll do some quick subnet maths, see how Windows finds a neighbour’s hardware address, follow the order Windows uses to turn a name into an address, and work with firewall profiles and rules. You’ll also see how servers combine network cards for speed and safety.

TimeYou needBy the end you can
About 50 minutesDC01 and SRV01 from Lesson 6, both runningWork out a subnet’s range, explain the name resolution order, read and change firewall profiles and rules, test TCP ports, and explain NIC teaming and SET

What it is, in one line

Windows Server networking covers how a server gets an address, finds other machines by name, decides which traffic its firewall lets in, and uses one or more network cards to reach everything.

In Simple Words

Houses, streets and a gatekeeper

Think of a town.

Every house has an address (the IP address), and houses on the same street (the same subnet) can walk over to each other directly, but to get to another street you go through the main road junction (the gateway). You usually know people by name rather than by address, so you first check your own notebook (the hosts file), then what you remember from before (the DNS cache), and only then ask the town’s information desk (the DNS server). Each house also has a gatekeeper (the firewall) with a list of who’s allowed in, and the rules depend on where you are: relaxed at home, strict in a coffee shop. Windows changes its rules in the same way, depending on where it thinks it is.

Engineer's View

Addresses, names, firewall and teaming

IPv4 and subnets. An address such as 10.0.0.10/24 has a network part (the first 24 bits, 10.0.0) and a host part (.10).

A /24 holds 256 addresses. The first is the network address and the last is the broadcast, which leaves 254 you can use. The private ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Keep IPv6 enabled on Windows Server, because Microsoft tests Windows with it switched on and turning it off causes strange problems.

ARP. Before Windows can send to a machine on the same subnet, it needs that machine’s hardware (MAC) address.

It asks using ARP and caches the answer, and Get-NetNeighbor shows you that cache. For another subnet it sends to the gateway’s MAC instead.

Name resolution order. For a name like dc01, Windows first checks the DNS client cache (which also holds the entries from the hosts file at C:\Windows\System32\drivers\etc\hosts), and then asks the configured DNS servers, adding the connection’s DNS suffix to short names.

Only when DNS fails does it fall back to local broadcast methods (LLMNR, NetBIOS and mDNS). Those are slow and attackers love to abuse them, so lots of companies switch them off.

Firewall profiles. Windows Defender Firewall has three profiles, Domain (when it can reach its domain controller), Private and Public.

Network Location Awareness (NLA) chooses the profile for each connection. Every rule applies to one or more profiles, and any inbound traffic that no rule allows gets blocked.

NIC teaming. Servers join network cards together for more bandwidth and so they keep working if one card fails.

The older LBFO teaming is still around, but on Hyper-V hosts Microsoft recommends Switch Embedded Teaming (SET), which is built into the Hyper-V virtual switch (Lesson 28). Inside a VM like the ones in your lab, the host takes care of redundancy and the VM only sees one card.

How it works, step by step

This is what happens when SRV01 connects to dc01 by name. Any step can fail by itself, and the lab tests each of them:

Windows Server networking: name, subnet check, ARP, port and firewall when SRV01 connects to DC01
  1. Resolve the name. The cache and hosts file are checked first, then the DNS server, and the answer is 10.0.0.10.
  2. Same subnet? SRV01 compares 10.0.0.10 with its own address and prefix. 10.0.0.20/24 and 10.0.0.10 both start with 10.0.0, so it sends directly; otherwise it would send to the gateway.
  3. Find the MAC address with ARP and cache it.
  4. Send the packet to the port, for example TCP 3389 for Remote Desktop.
  5. DC01’s firewall decides. If a rule for the current profile allows TCP 3389 the connection is accepted, and if not it’s quietly dropped.

These are the three firewall profiles and when Windows uses each one:

Windows Server networking firewall profiles: Domain, Private and Public

A server that suddenly drops into the Public profile is a classic outage, because the rules you wrote for the Domain profile stop applying, and that’s what happens in the work story below.

Hands-on Lab: Windows Server networking checks between DC01 and SRV01

Before you run any command, double-check it

Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.

Start DC01 and SRV01 and use PowerShell as administrator on each. Each step title tells you which server to use.

1Work out a subnet’s range (any machine)

Paste this whole block:

function Get-Subnet {
    param([string]$Address, [int]$Prefix)
    $ip   = ([ipaddress]$Address).GetAddressBytes()
    $mask = 0..3 | ForEach-Object { $b = [math]::Max(0, [math]::Min(8, $Prefix - 8 * $_)); [byte](256 - [math]::Pow(2, 8 - $b)) }
    $net  = 0..3 | ForEach-Object { $ip[$_] -band $mask[$_] }
    $bc   = 0..3 | ForEach-Object { $net[$_] + (255 - $mask[$_]) }
    [pscustomobject]@{
        Address     = $Address
        Prefix      = $Prefix
        Mask        = $mask -join '.'
        Network     = $net -join '.'
        Broadcast   = $bc -join '.'
        UsableHosts = [math]::Pow(2, 32 - $Prefix) - 2
    }
}

Run this to see all three in a table:

'10.0.0.10/24','192.168.10.77/26','172.16.5.200/20' | ForEach-Object { $a, $p = $_ -split '/'; Get-Subnet $a ([int]$p) } | Format-Table -AutoSize

You should see this:

Address       Prefix Mask            Network       Broadcast      UsableHosts
-------       ------ ----            -------       ---------      -----------
10.0.0.10         24 255.255.255.0   10.0.0.0      10.0.0.255             254
192.168.10.77     26 255.255.255.192 192.168.10.64 192.168.10.127          62
172.16.5.200      20 255.255.240.0   172.16.0.0    172.16.15.255         4094
Windows Server networking lab: subnet calculator output for /24, /26 and /20
This output is exact for the function in step 1.

Every extra bit of prefix halves the subnet, so a /26 has 62 usable hosts and a /20 has 4,094. If someone asks “is 10.0.0.200 on the same network as DC01?”, you can now say yes for certain, because it falls inside 10.0.0.0 to 10.0.0.255.

✅ Checkpoint: Your table matches the one above.

2Ping DC01 from SRV01

On SRV01, run this:

Test-NetConnection 10.0.0.10

You’ll most likely see PingSucceeded : False, even though both servers are fine. Hang on to that; it’s the first Break It below. For now, test a TCP port instead, since that’s what real applications use:

Still on SRV01, run this:

Test-NetConnection 10.0.0.10 -Port 3389 | Select-Object RemoteAddress, RemotePort, TcpTestSucceeded

You should see this:

RemoteAddress RemotePort TcpTestSucceeded
------------- ---------- ----------------
10.0.0.10           3389             True

✅ Checkpoint: Ping fails, but TCP 3389 (Remote Desktop, enabled in Lesson 6) succeeds.

3See ARP at work

On SRV01, run this:

Get-NetNeighbor -IPAddress 10.0.0.10, 10.0.0.1 | Select-Object IPAddress, LinkLayerAddress, State

You should see something like this:

IPAddress LinkLayerAddress  State
--------- ----------------  -----
10.0.0.1  52-54-00-12-35-00 Reachable
10.0.0.10 08-00-27-6E-4C-1A Reachable

While you were testing, SRV01 learned both MAC addresses through ARP. The 08-00-27 at the start is VirtualBox’s vendor code for virtual network cards, and when two machines claim the same IP, this table is where the mix-up shows.

✅ Checkpoint: Both DC01 and the gateway appear with a MAC address.

4Follow the name resolution order

On SRV01, try to resolve DC01 by name:

Resolve-DnsName dc01

It fails, because there’s no domain DNS yet and the public resolver has never heard of your DC01. Now add a line to SRV01’s hosts file, which is the very first place Windows looks:

Run these:

Add-Content C:\Windows\System32\drivers\etc\hosts "10.0.0.10    dc01"
Resolve-DnsName dc01 | Select-Object Name, Type, IPAddress
Get-DnsClientCache -Entry dc01 | Select-Object Entry, Data, TimeToLive

You should see something like this:

Name Type IPAddress
---- ---- ---------
dc01 A    10.0.0.10

Entry Data      TimeToLive
----- ----      ----------
dc01  10.0.0.10      86400

The hosts file beats DNS, and its entries live in the DNS client cache, which is how a forgotten hosts entry can quietly send a server to the wrong place for years. Take the line out now: open the hosts file in Notepad as administrator, delete it and run Clear-DnsClientCache. From Lesson 11 onwards, DNS does this job properly.

✅ Checkpoint: dc01 resolved to 10.0.0.10 from the hosts file, and you removed the line again.

5Check firewall profiles

On DC01, run these:

Get-NetConnectionProfile | Select-Object InterfaceAlias, Name, NetworkCategory
Get-NetFirewallProfile | Select-Object Name, Enabled, DefaultInboundAction

You should see something like this:

InterfaceAlias Name    NetworkCategory
-------------- ----    ---------------
Ethernet       Network          Public

Name    Enabled DefaultInboundAction
----    ------- --------------------
Domain     True        NotConfigured
Private    True        NotConfigured
Public     True        NotConfigured

The LabNet connection sits in the Public profile, because DC01 isn’t in a domain and Windows doesn’t trust the network.

All three profiles are switched on. NotConfigured looks alarming but only means “the built-in default”, which for inbound traffic is Block. After Lesson 11, DC01’s connection moves to DomainAuthenticated.

✅ Checkpoint: DC01 shows NetworkCategory Public and all three firewall profiles enabled.

6Find the rule that allows Remote Desktop

On DC01, run this:

Get-NetFirewallRule -DisplayGroup 'Remote Desktop' | Where-Object Enabled -eq True | Select-Object DisplayName, Profile, Direction, Action

You should see something like this:

DisplayName                           Profile Direction Action
-----------                           ------- --------- ------
Remote Desktop - User Mode (TCP-In)       Any   Inbound  Allow
Remote Desktop - User Mode (UDP-In)       Any   Inbound  Allow
Remote Desktop - Shadow (TCP-In)          Any   Inbound  Allow

These are the rules you switched on in Lesson 6, and Profile: Any is the reason step 2’s port test worked on the Public profile. Whenever a port test fails, this command shows you whether a rule exists, whether it’s enabled and which profiles it covers.

✅ Checkpoint: You can see enabled Remote Desktop rules with Profile Any.

7Check the routing table

On SRV01, run this:

Get-NetRoute -AddressFamily IPv4 | Where-Object DestinationPrefix -in '0.0.0.0/0','10.0.0.0/24' | Select-Object DestinationPrefix, NextHop, RouteMetric

You should see this:

DestinationPrefix NextHop  RouteMetric
----------------- -------  -----------
10.0.0.0/24       0.0.0.0          256
0.0.0.0/0         10.0.0.1         256

Two routes explain everything SRV01 does. Anything in 10.0.0.0/24 goes straight out (a next hop of 0.0.0.0 means “on this link”), and everything else (0.0.0.0/0, the default route) goes to the gateway 10.0.0.1. Keep this table in mind for Break It 2.

✅ Checkpoint: SRV01 has a local route for 10.0.0.0/24 and a default route through 10.0.0.1.

Break It, Then Fix It

Here are two network faults that look like “the server is down” when it isn’t.

1Break it: ping says the server is dead

On SRV01, run this:

Test-NetConnection 10.0.0.10

You’ll get something like this:

WARNING: Ping to 10.0.0.10 failed with status: TimedOut

ComputerName           : 10.0.0.10
RemoteAddress          : 10.0.0.10
InterfaceAlias         : Ethernet
SourceAddress          : 10.0.0.20
PingSucceeded          : False
PingReplyDetails (RTT) : 0 ms
Windows Server networking lab: ping fails but TCP port 3389 succeeds
Example output.

DC01 is up, and you connected to its port 3389 a minute ago. Windows Server’s firewall doesn’t answer ping (ICMP echo) by default, and a lot of outage calls begin with “I can’t ping it” when the server was fine the whole time.

To fix it, enable the built-in rule that allows ping on DC01:

Enable-NetFirewallRule -DisplayName 'File and Printer Sharing (Echo Request - ICMPv4-In)'
Get-NetFirewallRule -DisplayName 'File and Printer Sharing (Echo Request - ICMPv4-In)' | Select-Object Name, Enabled, Profile

You should see something like this:

Name                   Enabled Profile
----                   ------- -------
FPS-ICMP4-ERQ-In          True Private, Public
FPS-ICMP4-ERQ-In-NoScope  True Domain

Run Test-NetConnection 10.0.0.10 on SRV01 again and PingSucceeded comes back True. Windows ships this rule in more than one copy for different profiles, and enabling it by display name turns them all on. Lesson 23 looks at which servers should answer ping at all.

✅ Checkpoint: Ping from SRV01 to DC01 works after enabling the rule. Lesson learned: test the port the app uses, not just ping.

2Break it: the wrong gateway

On SRV01, swap the default gateway for an address that doesn’t exist:

Remove-NetRoute -DestinationPrefix 0.0.0.0/0 -Confirm:$false
New-NetRoute -DestinationPrefix 0.0.0.0/0 -InterfaceAlias Ethernet -NextHop 10.0.0.254 | Out-Null
Test-NetConnection 10.0.0.10 -Port 3389 | Select-Object TcpTestSucceeded
Test-NetConnection 1.1.1.1 -Port 53 | Select-Object TcpTestSucceeded

You’ll get something like this:

TcpTestSucceeded
----------------
            True

WARNING: TCP connect to (1.1.1.1 : 53) failed

TcpTestSucceeded
----------------
           False

DC01, on the same subnet, still works, but anything outside the subnet fails because the packets are going to a gateway that isn’t there. When local works and nothing else does, the gateway (or a route) is nearly always wrong.

To fix it, check the route table and then put the right gateway back:

Get-NetRoute -DestinationPrefix 0.0.0.0/0 | Select-Object DestinationPrefix, NextHop
Remove-NetRoute -DestinationPrefix 0.0.0.0/0 -Confirm:$false
New-NetRoute -DestinationPrefix 0.0.0.0/0 -InterfaceAlias Ethernet -NextHop 10.0.0.1 | Out-Null
Test-NetConnection 1.1.1.1 -Port 53 | Select-Object TcpTestSucceeded

You should see something like this:

DestinationPrefix NextHop
----------------- -------
0.0.0.0/0         10.0.0.254

TcpTestSucceeded
----------------
            True

✅ Checkpoint: SRV01 reaches 1.1.1.1 again through 10.0.0.1.

This happened at work

The server that thought it was in a coffee shop

A company ran its main application server with a firewall rule that allowed the app’s port on the Domain profile only, and for a year that worked fine. Then there was a power cut, and the application server came back up before the domain controllers did. When its network card connected, Windows couldn’t reach a DC, so it filed the network under Public.

Even after the DCs were back, the server stayed on Public. The app’s port was now blocked and 400 users got connection errors, yet the server itself looked healthy and even ping worked, because a separate rule allowed ping on all profiles.

The admin finally spotted it with Get-NetConnectionProfile, which showed NetworkCategory Public on a domain-joined server. Restarting the Network Location Awareness service (or disabling and re-enabling the network card) put it back on DomainAuthenticated in seconds.

The fix: the app’s firewall rule now covers every profile it needs, monitoring checks the network category on key servers, and “check the firewall profile” is written into the outage runbook.

The lesson: a firewall rule only works on the profile it’s attached to, so when a port suddenly stops answering, look at the profile before you start on the app.

Common mistakes and troubleshooting

Mistake or symptomWhat happensWhat to do instead
Using ping to decide a server is downWindows Server blocks ping by defaultTest the real port with Test-NetConnection -Port
Local subnet works, nothing else doesWrong or missing default gatewayCheck Get-NetRoute 0.0.0.0/0 and the gateway address
Wrong prefix lengthSome nearby hosts look remote, or remote ones look localCompare with the subnet plan; calculate the range
Old entries in the hosts fileThe server goes to the wrong IP for yearsKeep hosts files empty on servers; use DNS
Turning off IPv6Odd failures in Windows featuresLeave IPv6 enabled; filter it at the network if needed
Firewall rule only on the Domain profileBreaks when the network is detected as PublicCheck Get-NetConnectionProfile; scope rules to the right profiles
Turning the firewall off “to test” and leaving it offServer is wide openAdd a specific rule instead, and remove test changes
Duplicate MAC or IP after cloning VMsFlapping connectivityGenerate new MACs and run sysprep on clones
Using LBFO teaming under a Hyper-V switchNot recommended in current versionsUse Switch Embedded Teaming (SET) on Hyper-V hosts

Interview questions

Click a question to open it. Each one is written the way an interviewer would ask it. Under it you will see why they ask it and one way you could answer, in your own words.

Fresher level

1. Can you explain in simple words what a subnet mask does?

Why they ask this: Nearly every network problem starts with IP addressing, so they want to see you’ve got the basics.

How you might answer: A subnet mask splits an IP address into a network part and a host part. With 255.255.255.0, which is /24, the first three numbers are the network and the last one is the host.

That means 192.168.1.10 and 192.168.1.50 sit on the same network and can talk to each other directly.

2. A developer says the website on your server is down, but ping works fine. How would you check if the port is really open?

Why they ask this: A lot of freshers stop at ping, and they want to see you test the actual service rather than just the server.

How you might answer: I’d run Test-NetConnection server -Port 443 in PowerShell, which shows TcpTestSucceeded as True or False, so I know whether the port answers.

I wouldn’t rely on ping, because it only tells me the server is up, and it’s often blocked anyway.

3. Windows Firewall has three profiles. Can you name them and tell me how Windows picks one?

Why they ask this: If you don’t know about profiles, you can’t explain why a rule isn’t working, so they’re checking you know how rules get applied.

How you might answer: They’re Domain, Private and Public, and Network Location Awareness picks one for each network connection.

Every firewall rule applies to one or more profiles, so a rule made only for Domain does nothing once the connection is marked Public.

2–5 years experience

4. A user pings a server by name and gets an old, wrong IP address. Walk me through how Windows resolves a name, and where that wrong answer could come from.

Why they ask this: Knowing the full lookup order means you can track down a stale answer instead of guessing.

How you might answer: Windows checks the DNS client cache first, which also holds the hosts file entries. If there’s nothing there it asks the configured DNS servers with the DNS suffix added, and after that it falls back to LLMNR, NetBIOS and mDNS.

So I’d look at ipconfig /displaydns or Get-DnsClientCache first, then the hosts file, and then what the DNS server sends back, because the wrong answer is usually sitting in one of those.

5. A server can reach other machines on its own subnet, but not the internet. What would you check, and in what order?

Why they ask this: They want to see you work outwards from the route table one step at a time, rather than changing things at random.

How you might answer: I’d start with the default route, using Get-NetRoute and looking for 0.0.0.0/0 to make sure a gateway is set, and then test whether that gateway answers.

If the gateway’s fine I’d move on to DNS, and last of all I’d look for a firewall or proxy on the path blocking the traffic.

6. Say you notice a domain-joined server shows NetworkCategory Public. Why should that worry you, and how would you fix it?

Why they ask this: Network Location Awareness can quietly break firewall rules on servers, and they want to know you understand how.

How you might answer: On the Public profile, rules made for the Domain profile stop applying, so services can break. It usually happens because NLA couldn’t reach a domain controller when the network came up.

I’d sort out DNS and make sure the server can reach a DC, then restart the NLA service or the network adapter so it picks up the domain again.

Senior level

7. Your security team asks you to turn off LLMNR and NetBIOS over TCP/IP on all servers. Why would they ask that, and is it safe to do?

Why they ask this: They want to see you understand name-resolution attacks and can weigh the risk of a change yourself rather than just following orders.

How you might answer: LLMNR and NetBIOS send broadcast queries, and an attacker on the same network can answer them and capture credentials with tools like Responder, so the risk is real.

If DNS is working properly we don’t need those protocols and it’s safe to turn them off. I’d do it through Group Policy and DHCP options and try it on a few servers first.

8. You’re building a new Hyper-V host and need the network to survive a NIC or switch failure. How would you design it?

Why they ask this: They want to see you know the current recommendations and think about redundancy end to end, which is more than adding a second cable.

How you might answer: I’d put in two or more physical NICs going to separate switches and team them with Switch Embedded Teaming inside the Hyper-V switch, since LBFO teaming isn’t recommended under Hyper-V any more.

Management and storage traffic would get their own vNICs, or separate RDMA NICs for storage, with QoS so no one type of traffic can starve the rest.

9. Say you join a team that manages firewall rules on hundreds of servers by hand. How would you bring that under control?

Why they ask this: At that scale you need policies and standards rather than clicks, and they want to hear how you’d deal with drift.

How you might answer: I’d move the rules into Group Policy or another configuration tool, with rule sets grouped by server role, and scope each rule to specific remote addresses instead of leaving it open to everyone.

I’d switch on logging for blocked traffic and review the rules on a schedule. We’d stop making local rule changes, since the policy would overwrite them anyway.

Quick quiz

Q1. How many usable hosts are in a /26 subnet?

  1. 30
  2. 62
  3. 126
Show answer

B — 64 addresses minus the network and broadcast addresses = 62.

Q2. Where does Windows look first when resolving a name?

  1. The DNS server
  2. The DNS client cache, which includes the hosts file
  3. NetBIOS
Show answer

B — The cache (with hosts entries) comes before asking a DNS server.

Q3. Ping to DC01 fails but TCP 3389 works. Most likely cause?

  1. DC01 is down
  2. The firewall blocks ICMP echo
  3. Wrong IP address
Show answer

B — Windows Server doesn’t answer ping by default.

Q4. SRV01 reaches DC01 but not the internet. What do you check first?

  1. The hosts file
  2. The default gateway route
  3. The DNS cache
Show answer

B — Local works, remote doesn’t: check 0.0.0.0/0.

Q5. In the work story, why did the app port stop answering?

  1. The app crashed
  2. The server’s network was classified as Public, so the Domain-only rule stopped applying
  3. The cable failed
Show answer

B — Check Get-NetConnectionProfile when ports suddenly close.

Quick recap

  • Windows Server networking starts with address, prefix and gateway, and the subnet maths tells you the range.
  • ARP finds MAC addresses on the same subnet, and Get-NetNeighbor shows them.
  • Name resolution order: cache and hosts file, then DNS servers, then LLMNR and NetBIOS.
  • The firewall profiles are Domain, Private, Public. Rules apply per profile, and inbound traffic is blocked unless a rule allows it.
  • Test the real port with Test-NetConnection -Port, because ping is often blocked.
  • On Hyper-V hosts, team NICs with SET.

Next lesson

Lesson 10: Active Directory concepts → You’ll learn what Active Directory is, how forests, domains, OUs and sites fit together, what the global catalog and FSMO roles do, and you’ll choose the domain name for your lab.

Further reading: Windows Server networking

To go further with Windows Server networking, Microsoft’s Windows Firewall overview explains profiles and rules, and the NetTCPIP PowerShell reference covers every networking cmdlet used here. The full plan for this course is on the Windows Server Administration course page.

Scroll to Top

This website uses cookies

We use a few cookies to keep this site working. If you allow it, we also use Google Analytics to count visits so we can improve our lessons. You can accept all, deny the optional ones, or choose what to allow.