大网数据广告活动
网络与域名解析

Can't access SMB file server through DNS CNAME

· 52CE 我爱测

Describes an issue in which you can't access SMB file server share by using the DNS CNAME. Provides a resolution.

This article explains how to resolve issues when accessing a Server Message Block (SMB) server by using a canonical name (CNAME).

Symptoms

Consider the following scenario:

  • You have an SMB file server, such as a Windows Server-based computer or a network attached storage (NAS).
  • The server has files and resources that are accessible by using their NetBIOS name, Domain Name System (DNS) fully qualified domain name (FQDN), and alias (CNAME).
  • You have a client that's running Windows 10, Windows 11, Windows Server 2016, or a later version of Windows Server.
  • On the client, you can use the NetBIOS name or FQDN to access the SMB share with an application or a user account.

In this scenario, when you use the CNAME to access the SMB share by running one of the following commands, the command fails.

  • \\CNAME.contoso.com\share_name
  • \\CNAME\share_name
  • NET USE * \\CNAME\share_name
  • NET USE * \\CNAME.contoso.com\share_name
  • New-PSDrive -Name "x" -PSProvider "FileSystem" -Root "\\CNAME\share_name" -Persist
  • New-PSDrive -Name "x" -PSProvider "FileSystem" -Root "\\CNAME.contoso.com\share_name" -Persist

And you might receive an error message that resembles one of the following examples:

\\CNAME.contoso.com\share_name is not accessible. You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions.

Account restriction is preventing this user from signing in. For example: blank passwords are not allowed, sign-in times are limited or a policy restriction has been enforced.

\\CNAME.contoso.com\share_name is not accessible. You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions.

Logon Failure: The target account name is incorrect.

Cause

This issue can be caused by one of the following reasons:

  • Configuration issue or SMB server service hardening issue.
  • The service principal name (SPN) for the DNS alias (CNAME) record for the file share server is missing.

Resolution

To resolve this issue, avoid using the DNS CNAME to configure the file server's alternative name. Instead, configure it by defining an alias by using the netdom command:

Netdom computername <ComputerOriginalName> /add:<Alias>

For more information, see Using Computer Name Aliases in place of DNS CNAME Records.

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
- Supported versions of Windows Server · Source date 02/12/2026
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。