DFS Namespace clients get the wrong target or no target at all
The namespace is up but clients are being sent to a target that is offline, or to one across the wide area link.
What you see
A DFS path opens slowly or not at all. Some sites are fine and others are not, which points at referral ordering rather than the namespace itself.
What is actually wrong
Site costing not configured, so referrals are effectively random. Or a folder target that is offline but still enabled, which clients keep being sent to.
Codes and articles
Fixes (2)
Make referrals follow the site topology
Clients are being sent across the wide area link.
See what a client is actually being told.
dfsutil /pktinfodfsutil cache referral flush
Check site costing is enabled on the namespace.
Get-DfsnRoot | Format-List Path,State,Flags,TimeToLiveSecEnable it. Without costing, a client picks a target at random from those with equal priority.
Set-DfsnRoot -Path '\\example.local\Shares' -EnableSiteCosting $trueSite costing makes referrals follow the Active Directory sites and services topology, so a client is offered its local server first. Without it, half the clients at a branch office will work over the wide area link and nobody will know why some are slow.
Confirm the subnets are actually mapped to sites — costing depends entirely on that being right.
Get-ADReplicationSubnet -Filter * | Format-Table Name,Sitenltest /dsgetsite
Set target priority explicitly where a particular server should be preferred.
Set-DfsnServerConfiguration -TargetPath '\\fs01\share' -ReferralPriorityClass GlobalHighFlush the client cache and re-test.
dfsutil cache referral flushdfsutil /pktinfo
dfsutil /pktinfoTake the dead target out of the namespace
The path fails entirely for some clients.
List the folder targets and their state.
Get-DfsnFolder -Path '\\example.local\Shares\*' | Format-Table Path,StateGet-DfsnFolderTarget -Path '\\example.local\Shares\Data' | Format-Table TargetPath,State,ReferralPriorityClass
Test each target directly to find which is unreachable.
Get-DfsnFolderTarget -Path '\\example.local\Shares\Data' | ForEach-Object { $t = $_.TargetPath [PSCustomObject]@{ Target = $t; Reachable = (Test-Path $t) }}
DFS keeps offering a target until it is disabled, and a client that is referred to a dead one waits for a timeout before trying another. Disabling it is instant relief for every client.
Disable the failed target rather than deleting it, so it can be re-enabled when the server returns.
Set-DfsnFolderTarget -Path '\\example.local\Shares\Data' -TargetPath '\\fs02\data' -State OfflineCheck the namespace servers themselves are healthy.
Get-DfsnRootTarget -Path '\\example.local\Shares' | Format-Table TargetPath,Statedcdiag /test:dfsrevent /v | Select-String 'passed|failed'
Reduce the referral time to live if targets change often, so clients recover faster.
Set-DfsnFolder -Path '\\example.local\Shares\Data' -TimeToLiveSec 300
Get-DfsnFolderTarget -Path '\\example.local\Shares\Data' | Format-Table TargetPath,StateWhere this stops. This write-up was written and checked by hand. It says what each step changes, how to confirm it worked and how to reverse it, and anything destructive is flagged before you reach it. If it does not match what your machine is doing, search the Support Centre for the exact code or message — and when something needs a person, get in touch.