Windows Server  ·  high  ·  Storage, SAN & file services

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

Event 14550The namespace cannot be queriedno referralsDFS referral0x80070035 dfs

Fixes (2)

Make referrals follow the site topology
Elevated PowerShell40 minutesmedium riskreversible

Clients are being sent across the wide area link.

  1. See what a client is actually being told.

    PowerShell
    dfsutil /pktinfodfsutil cache referral flush
  2. Check site costing is enabled on the namespace.

    PowerShell
    Get-DfsnRoot | Format-List Path,State,Flags,TimeToLiveSec
  3. Enable it. Without costing, a client picks a target at random from those with equal priority.

    PowerShell
    Set-DfsnRoot -Path '\\example.local\Shares' -EnableSiteCosting $true

    Site 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.

  4. Confirm the subnets are actually mapped to sites — costing depends entirely on that being right.

    PowerShell
    Get-ADReplicationSubnet -Filter * | Format-Table Name,Sitenltest /dsgetsite
  5. Set target priority explicitly where a particular server should be preferred.

    PowerShell
    Set-DfsnServerConfiguration -TargetPath '\\fs01\share' -ReferralPriorityClass GlobalHigh
  6. Flush the client cache and re-test.

    PowerShell
    dfsutil cache referral flushdfsutil /pktinfo
Confirm it workedA client at each site is referred to its local server.
PowerShell
dfsutil /pktinfo
If you need to undo itSet-DfsnRoot -EnableSiteCosting $false returns to the previous behaviour.
Take the dead target out of the namespace
Elevated PowerShell30 minutesmedium riskreversible

The path fails entirely for some clients.

  1. List the folder targets and their state.

    PowerShell
    Get-DfsnFolder -Path '\\example.local\Shares\*' | Format-Table Path,StateGet-DfsnFolderTarget -Path '\\example.local\Shares\Data' | Format-Table TargetPath,State,ReferralPriorityClass
  2. Test each target directly to find which is unreachable.

    PowerShell
    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.

  3. Disable the failed target rather than deleting it, so it can be re-enabled when the server returns.

    PowerShell
    Set-DfsnFolderTarget -Path '\\example.local\Shares\Data' -TargetPath '\\fs02\data' -State Offline
  4. Check the namespace servers themselves are healthy.

    PowerShell
    Get-DfsnRootTarget -Path '\\example.local\Shares' | Format-Table TargetPath,Statedcdiag /test:dfsrevent /v | Select-String 'passed|failed'
  5. Reduce the referral time to live if targets change often, so clients recover faster.

    PowerShell
    Set-DfsnFolder -Path '\\example.local\Shares\Data' -TimeToLiveSec 300
Confirm it workedThe path opens from every site and only healthy targets are online.
PowerShell
Get-DfsnFolderTarget -Path '\\example.local\Shares\Data' | Format-Table TargetPath,State
If you need to undo itSet the target state back to Online when the server returns.

Where 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.