How to configure a Windows machine to allow file sharing with a DNS alias

Better Stack Team
Updated on November 23, 2023

To configure a Windows machine to allow file sharing with a DNS alias, you'll need to set up the appropriate DNS alias and ensure that the Windows file sharing settings and permissions are correctly configured.

Here's a step-by-step guide:

Configuring a DNS Alias:

  1. DNS Configuration:
    • Access your DNS server or domain registrar's control panel.
    • Create a new DNS alias (CNAME record) pointing to the hostname of the Windows machine that's hosting the shared files.
    • For example, if the hostname of the machine hosting the files is "fileserver" and you want to create an alias "sharedfiles," create a CNAME record that points "sharedfiles" to "fileserver".

Configuring File Sharing on Windows:

  1. Open File Explorer and navigate to the folder you want to share.
  2. Share the Folder:
    • Right-click on the folder, select "Properties," and then go to the "Sharing" tab.
    • Click "Share" and follow the steps to share the folder. Choose the appropriate share name.
  3. Set Permissions:
    • After sharing the folder, click on "Permissions" to set the permissions for users or groups accessing the shared folder. Ensure the necessary read or write permissions are assigned according to your requirements.
  4. Access Control Panel:
    • Go to Control Panel > Network and Sharing Center.
  5. Change Advanced Sharing Settings:
    • Click on "Change advanced sharing settings" on the left panel.
    • Ensure that network discovery, file and printer sharing, and public folder sharing are turned on.
  6. Allow File and Printer Sharing through Windows Firewall:
    • Go to Control Panel > System and Security > Windows Defender Firewall.
    • Click on "Allow an app or feature through Windows Defender Firewall."
    • Ensure that "File and Printer Sharing" is allowed for the relevant network profile (such as private or domain networks).

Accessing the Shared Files using DNS Alias:

  1. Test Access:
    • Open File Explorer on another Windows machine on the same network.
    • In the address bar, type \\\\DNSAlias (replace DNSAlias with the actual DNS alias you've created).
    • You should be prompted to enter credentials if required. Enter the credentials for a user who has permissions to access the shared folder.
  2. Accessing from other devices:
    • On non-Windows devices, you might need to use a different approach to access the shared files using the DNS alias. For example, using the UNC path (\DNSAlias\sharedfolder) in the file manager or using the IP address associated with the DNS alias.

Ensure that the machines on the network can resolve the DNS alias correctly by pinging the alias to confirm it resolves to the IP address of the file-sharing Windows machine.

Remember to secure your shared files by applying appropriate permissions and utilizing strong passwords to protect access to the shared folders.

Got an article suggestion? Let us know
Explore more
Licensed under CC-BY-NC-SA

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Make your mark

Join the writer's program

Are you a developer and love writing and sharing your knowledge with the world? Join our guest writing program and get paid for writing amazing technical guides. We'll get them to the right readers that will appreciate them.

Write for us
Writer of the month
Marin Bezhanov
Marin is a software engineer and architect with a broad range of experience working...
Build on top of Better Stack

Write a script, app or project on top of Better Stack and share it with the world. Make a public repository and share it with us at our email.

or submit a pull request and help us build better products for everyone.

See the full list of amazing projects on github