I am working on a project that requires that I have an alias in my hosts file that maps \\share to localhost. I added this line "127.0.0.1 localhost share" to my hosts file, and when I ping share, I get a response from localhost so I know that the alias is working. I have some locally shared folders that I can access through the Windows File Explorer when I access \\localhost\dir1, but when I type \\share\dir1, I get a prompt asking for me to enter network credentials. None of my network credentials work, and I am unable to access \\share. I did some research and determined that I can go into Control Panel\All Control Panel Items\Network and Sharing Center\Advanced sharing settings and disable password requirements, although I am on a domain that has restricted this option. Is there any other way that I can access \\share\dir1 without requiring a username and password?
Windows 10 Hosts file alias not working with file share
hosts-filenetwork-sharewindows
Related Topic
- Windows – How to force Windows to prompt for credentials while accessing share
- Debian – Local alias in /etc/hosts not working anymore without internet connection
- Windows – File & Printer Sharing not working on Windows Server 2008 R2
- Windows File Sharing not working
- Windows – Why does Windows prompt for credentials when accessing the C$ share, but not when accessing a regular folder share
Best Answer
I'm guessing this is a result of SMB using NETBIOS; it listens with an SNP of IP and FQDN. Your alias is essentially unknown to SMB.
You could try either 1) using
netdom
to add an alternate name, or 2) disable NETBIOS over TCP, which forces SMB direct hostingAdditional reading: https://support.microsoft.com/en-us/help/3181029/smb-file-server-share-access-is-unsuccessful-through-dns-cname-alias
https://support.microsoft.com/en-us/help/204279/direct-hosting-of-smb-over-tcp-ip